Skip to content

Commit 3f9185b

Browse files
committed
---
yaml --- r: 65434 b: refs/heads/master c: dcd8490 h: refs/heads/master v: v3
1 parent 0f611f1 commit 3f9185b

36 files changed

+171
-209
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0d9ea4e2d1345f259278931637dbcecdb483dc68
2+
refs/heads/master: dcd84901c674eda61fefc363a0adc44790b4e24f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/doc/rust.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,8 +2033,7 @@ as
20332033
=
20342034
~~~~
20352035

2036-
Operators at the same precedence level are evaluated left-to-right. [Unary operators](#unary-operator-expressions)
2037-
have the same precedence level and it is stronger than any of the binary operators'.
2036+
Operators at the same precedence level are evaluated left-to-right.
20382037

20392038
### Grouped expressions
20402039

trunk/src/compiletest/header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
9999
return false;
100100

101101
fn xfail_target() -> ~str {
102-
~"xfail-" + str::to_owned(os::SYSNAME)
102+
~"xfail-" + os::SYSNAME
103103
}
104104
}
105105
@@ -173,7 +173,7 @@ fn parse_name_directive(line: &str, directive: &str) -> bool {
173173

174174
fn parse_name_value_directive(line: &str,
175175
directive: ~str) -> Option<~str> {
176-
let keycolon = directive + ~":";
176+
let keycolon = directive + ":";
177177
match str::find_str(line, keycolon) {
178178
Some(colon) => {
179179
let value = str::slice(line, colon + str::len(keycolon),

trunk/src/compiletest/procsrv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
2424
let mut env = os::env();
2525

2626
// Make sure we include the aux directory in the path
27-
assert!(prog.ends_with(~".exe"));
28-
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ~".libaux";
27+
assert!(prog.ends_with(".exe"));
28+
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
2929

3030
env = do vec::map(env) |pair| {
3131
let (k,v) = *pair;
32-
if k == ~"PATH" { (~"PATH", v + ~";" + lib_path + ~";" + aux_path) }
32+
if k == ~"PATH" { (~"PATH", v + ";" + lib_path + ";" + aux_path) }
3333
else { (k,v) }
3434
};
3535
if str::ends_with(prog, "rustc.exe") {

trunk/src/compiletest/runtest.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
378378
was_expected = true;
379379
}
380380

381-
if !was_expected && is_compiler_error_or_warning(str::to_owned(line)) {
381+
if !was_expected && is_compiler_error_or_warning(line) {
382382
fatal_ProcRes(fmt!("unexpected compiler error or warning: '%s'",
383383
line),
384384
ProcRes);
@@ -596,8 +596,7 @@ fn make_lib_name(config: &config, auxfile: &Path, testfile: &Path) -> Path {
596596
}
597597

598598
fn make_exe_name(config: &config, testfile: &Path) -> Path {
599-
Path(output_base_name(config, testfile).to_str() +
600-
str::to_owned(os::EXE_SUFFIX))
599+
Path(output_base_name(config, testfile).to_str() + os::EXE_SUFFIX)
601600
}
602601

603602
fn make_run_args(config: &config, _props: &TestProps, testfile: &Path) ->
@@ -606,7 +605,7 @@ fn make_run_args(config: &config, _props: &TestProps, testfile: &Path) ->
606605
// then split apart its command
607606
let toolargs = split_maybe_args(&config.runtool);
608607

609-
let mut args = toolargs + ~[make_exe_name(config, testfile).to_str()];
608+
let mut args = toolargs + [make_exe_name(config, testfile).to_str()];
610609
let prog = args.shift();
611610
return ProcArgs {prog: prog, args: args};
612611
}
@@ -655,7 +654,7 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[~str]) -> ~str {
655654
#[cfg(target_os = "win32")]
656655
fn make_cmdline(libpath: &str, prog: &str, args: &[~str]) -> ~str {
657656
fmt!("%s %s %s", lib_path_cmd_prefix(libpath), prog,
658-
str::connect(args, ~" "))
657+
str::connect(args, " "))
659658
}
660659

661660
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
@@ -776,8 +775,8 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
776775
for args.args.each |tv| {
777776
newcmd_out.push_str(" ");
778777
newcmd_err.push_str(" ");
779-
newcmd_out.push_str(tv.to_owned());
780-
newcmd_err.push_str(tv.to_owned());
778+
newcmd_out.push_str(*tv);
779+
newcmd_err.push_str(*tv);
781780
}
782781

783782
newcmd_out.push_str(" 2>/dev/null");

trunk/src/libextra/getopts.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ pub struct Opt {
110110
}
111111

112112
fn mkname(nm: &str) -> Name {
113-
let unm = str::to_owned(nm);
114-
return if nm.len() == 1u {
115-
Short(str::char_at(unm, 0u))
116-
} else { Long(unm) };
113+
if nm.len() == 1u {
114+
Short(str::char_at(nm, 0u))
115+
} else {
116+
Long(nm.to_owned())
117+
}
117118
}
118119

119120
/// Create an option that is required and takes an argument
@@ -195,19 +196,19 @@ pub enum Fail_ {
195196
pub fn fail_str(f: Fail_) -> ~str {
196197
return match f {
197198
ArgumentMissing(ref nm) => {
198-
~"Argument to option '" + *nm + "' missing."
199+
fmt!("Argument to option '%s' missing.", *nm)
199200
}
200201
UnrecognizedOption(ref nm) => {
201-
~"Unrecognized option: '" + *nm + "'."
202+
fmt!("Unrecognized option: '%s'.", *nm)
202203
}
203204
OptionMissing(ref nm) => {
204-
~"Required option '" + *nm + "' missing."
205+
fmt!("Required option '%s' missing.", *nm)
205206
}
206207
OptionDuplicated(ref nm) => {
207-
~"Option '" + *nm + "' given more than once."
208+
fmt!("Option '%s' given more than once.", *nm)
208209
}
209210
UnexpectedArgument(ref nm) => {
210-
~"Option " + *nm + " does not take an argument."
211+
fmt!("Option '%s' does not take an argument.", *nm)
211212
}
212213
};
213214
}
@@ -245,11 +246,11 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result {
245246
let mut names;
246247
let mut i_arg = None;
247248
if cur[1] == '-' as u8 {
248-
let tail = str::slice(cur, 2, curlen).to_owned();
249+
let tail = str::slice(cur, 2, curlen);
249250
let mut tail_eq = ~[];
250251
for str::each_splitn_char(tail, '=', 1) |s| { tail_eq.push(s.to_owned()) }
251252
if tail_eq.len() <= 1 {
252-
names = ~[Long(tail)];
253+
names = ~[Long(tail.to_owned())];
253254
} else {
254255
names =
255256
~[Long(copy tail_eq[0])];

trunk/src/libextra/net_ip.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ pub mod v4 {
230230
let input_is_inaddr_none =
231231
result::get(&ip_rep_result).as_u32() == INADDR_NONE;
232232

233-
let new_addr = uv_ip4_addr(str::to_owned(ip), 22);
233+
let new_addr = uv_ip4_addr(ip, 22);
234234
let reformatted_name = uv_ip4_name(&new_addr);
235235
debug!("try_parse_addr: input ip: %s reparsed ip: %s",
236236
ip, reformatted_name);
@@ -259,7 +259,6 @@ pub mod v6 {
259259
use uv_ip6_name = uv::ll::ip6_name;
260260

261261
use core::result;
262-
use core::str;
263262

264263
/**
265264
* Convert a str to `ip_addr`
@@ -285,7 +284,7 @@ pub mod v6 {
285284
pub fn try_parse_addr(ip: &str) -> result::Result<IpAddr,ParseAddrErr> {
286285
unsafe {
287286
// need to figure out how to establish a parse failure..
288-
let new_addr = uv_ip6_addr(str::to_owned(ip), 22);
287+
let new_addr = uv_ip6_addr(ip, 22);
289288
let reparsed_name = uv_ip6_name(&new_addr);
290289
debug!("v6::try_parse_addr ip: '%s' reparsed '%s'",
291290
ip, reparsed_name);

trunk/src/libextra/net_url.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ fn get_path(rawurl: &str, authority: bool) ->
585585
}
586586
}
587587

588-
return Ok((decode_component(str::slice(rawurl, 0, end).to_owned()),
588+
return Ok((decode_component(str::slice(rawurl, 0, end)),
589589
str::slice(rawurl, end, len).to_owned()));
590590
}
591591

@@ -596,14 +596,13 @@ fn get_query_fragment(rawurl: &str) ->
596596
if str::starts_with(rawurl, "#") {
597597
let f = decode_component(str::slice(rawurl,
598598
1,
599-
str::len(rawurl)).to_owned());
599+
str::len(rawurl)));
600600
return Ok((~[], Some(f)));
601601
} else {
602602
return Ok((~[], None));
603603
}
604604
}
605-
let (q, r) = split_char_first(str::slice(rawurl, 1,
606-
str::len(rawurl)).to_owned(), '#');
605+
let (q, r) = split_char_first(str::slice(rawurl, 1, rawurl.len()), '#');
607606
let f = if str::len(r) != 0 {
608607
Some(decode_component(r)) } else { None };
609608
return Ok((query_from_str(q), f));

trunk/src/libextra/sha1.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,7 @@ mod tests {
399399
let mut left = len;
400400
while left > 0u {
401401
let take = (left + 1u) / 2u;
402-
sh.input_str(str::slice(t.input, len - left,
403-
take + len - left).to_owned());
402+
sh.input_str(t.input.slice(len - left, take + len - left));
404403
left = left - take;
405404
}
406405
let out = sh.result();

trunk/src/libextra/time.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
293293

294294
let mut i = 0u;
295295
while i < digits {
296-
let range = str::char_range_at(str::to_owned(ss), pos);
296+
let range = str::char_range_at(ss, pos);
297297
pos = range.next;
298298

299299
match range.ch {
@@ -632,7 +632,7 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
632632
}
633633
}
634634

635-
do io::with_str_reader(str::to_owned(format)) |rdr| {
635+
do io::with_str_reader(format) |rdr| {
636636
let mut tm = Tm {
637637
tm_sec: 0_i32,
638638
tm_min: 0_i32,
@@ -844,7 +844,7 @@ priv fn do_strftime(format: &str, tm: &Tm) -> ~str {
844844
845845
let mut buf = ~"";
846846

847-
do io::with_str_reader(str::to_owned(format)) |rdr| {
847+
do io::with_str_reader(format) |rdr| {
848848
while !rdr.eof() {
849849
match rdr.read_char() {
850850
'%' => buf += parse_type(rdr.read_char(), tm),

trunk/src/libextra/workcache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ struct Logger {
201201

202202
pub impl Logger {
203203
fn info(&self, i: &str) {
204-
io::println(~"workcache: " + i.to_owned());
204+
io::println(~"workcache: " + i);
205205
}
206206
}
207207

trunk/src/librustc/back/link.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,16 +741,14 @@ pub fn mangle_internal_name_by_seq(ccx: @CrateContext, flav: &str) -> ~str {
741741

742742

743743
pub fn output_dll_filename(os: session::os, lm: LinkMeta) -> ~str {
744-
let libname = fmt!("%s-%s-%s", lm.name, lm.extras_hash, lm.vers);
745744
let (dll_prefix, dll_suffix) = match os {
746745
session::os_win32 => (win32::DLL_PREFIX, win32::DLL_SUFFIX),
747746
session::os_macos => (macos::DLL_PREFIX, macos::DLL_SUFFIX),
748747
session::os_linux => (linux::DLL_PREFIX, linux::DLL_SUFFIX),
749748
session::os_android => (android::DLL_PREFIX, android::DLL_SUFFIX),
750749
session::os_freebsd => (freebsd::DLL_PREFIX, freebsd::DLL_SUFFIX),
751750
};
752-
return str::to_owned(dll_prefix) + libname +
753-
str::to_owned(dll_suffix);
751+
fmt!("%s%s-%s-%s%s", dll_prefix, lm.name, lm.extras_hash, lm.vers, dll_suffix)
754752
}
755753

756754
// If the user wants an exe generated we need to invoke

trunk/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ pub fn type_to_str_inner(names: @TypeNames, outer0: &[TypeRef], ty: TypeRef)
20142014
let mut first: bool = true;
20152015
for tys.each |t| {
20162016
if first { first = false; } else { s += ", "; }
2017-
s += type_to_str_inner(names, outer, *t).to_owned();
2017+
s += type_to_str_inner(names, outer, *t);
20182018
}
20192019
// [Note at-str] FIXME #2543: Could rewrite this without the copy,
20202020
// but need better @str support.

trunk/src/librustc/metadata/loader.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ pub fn list_file_metadata(intr: @ident_interner,
268268
match get_metadata_section(os, path) {
269269
option::Some(bytes) => decoder::list_crate_metadata(intr, bytes, out),
270270
option::None => {
271-
out.write_str(~"could not find metadata in "
272-
+ path.to_str() + ".\n");
271+
out.write_str(fmt!("could not find metadata in %s.\n", path.to_str()))
273272
}
274273
}
275274
}

trunk/src/librustc/metadata/tyencode.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ pub fn enc_ty(w: @io::Writer, cx: @ctxt, t: ty::t) {
8989
let abbrev_len = 3u + estimate_sz(pos) + estimate_sz(len);
9090
if abbrev_len < len {
9191
// I.e. it's actually an abbreviation.
92-
let s = ~"#" + uint::to_str_radix(pos, 16u) + ":" +
93-
uint::to_str_radix(len, 16u) + "#";
92+
let s = fmt!("#%x:%x#", pos, len);
9493
let a = ty_abbrev { pos: pos, len: len, s: @s };
9594
abbrevs.insert(t, a);
9695
}

trunk/src/librustc/middle/trans/_match.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ pub fn variant_opt(bcx: block, pat_id: ast::node_id)
314314
pub enum TransBindingMode {
315315
TrByValue(/*ismove:*/ bool, /*llbinding:*/ ValueRef),
316316
TrByRef,
317-
TrByImplicitRef
318317
}
319318

320319
/**
@@ -881,7 +880,7 @@ fn match_datum(bcx: block, val: ValueRef, pat_id: ast::node_id) -> Datum {
881880
//! we should just pass around a Datum and be done with it.
882881
883882
let ty = node_id_type(bcx, pat_id);
884-
Datum {val: val, ty: ty, mode: datum::ByRef, source: RevokeClean}
883+
Datum {val: val, ty: ty, mode: datum::ByRef(RevokeClean)}
885884
}
886885

887886

@@ -988,7 +987,7 @@ pub fn root_pats_as_necessary(mut bcx: block,
988987
let pat_id = br.pats[col].id;
989988
if pat_id != 0 {
990989
let datum = Datum {val: val, ty: node_id_type(bcx, pat_id),
991-
mode: ByRef, source: ZeroMem};
990+
mode: ByRef(ZeroMem)};
992991
bcx = datum.root_and_write_guard(bcx, br.pats[col].span, pat_id, 0);
993992
}
994993
}
@@ -1146,7 +1145,7 @@ pub fn store_non_ref_bindings(bcx: block,
11461145
TrByValue(is_move, lldest) => {
11471146
let llval = Load(bcx, binding_info.llmatch); // get a T*
11481147
let datum = Datum {val: llval, ty: binding_info.ty,
1149-
mode: ByRef, source: ZeroMem};
1148+
mode: ByRef(ZeroMem)};
11501149
bcx = {
11511150
if is_move {
11521151
datum.move_to(bcx, INIT, lldest)
@@ -1161,7 +1160,7 @@ pub fn store_non_ref_bindings(bcx: block,
11611160
temp_cleanups
11621161
}
11631162
}
1164-
TrByRef | TrByImplicitRef => {}
1163+
TrByRef => {}
11651164
}
11661165
}
11671166
return bcx;
@@ -1192,13 +1191,6 @@ pub fn insert_lllocals(bcx: block,
11921191
TrByRef => {
11931192
binding_info.llmatch
11941193
}
1195-
1196-
// Ugly: for implicit ref, we actually want a T*, but
1197-
// we have a T**, so we had to load. This will go away
1198-
// once implicit refs go away.
1199-
TrByImplicitRef => {
1200-
Load(bcx, binding_info.llmatch)
1201-
}
12021194
};
12031195

12041196
bcx.fcx.lllocals.insert(binding_info.id,
@@ -1254,7 +1246,7 @@ pub fn compile_guard(bcx: block,
12541246
TrByValue(_, llval) => {
12551247
bcx = glue::drop_ty(bcx, llval, binding_info.ty);
12561248
}
1257-
TrByRef | TrByImplicitRef => {}
1249+
TrByRef => {}
12581250
}
12591251
bcx.fcx.lllocals.remove(&binding_info.id);
12601252
}
@@ -1757,7 +1749,7 @@ pub fn bind_irrefutable_pat(bcx: block,
17571749
if make_copy {
17581750
let binding_ty = node_id_type(bcx, pat.id);
17591751
let datum = Datum {val: val, ty: binding_ty,
1760-
mode: ByRef, source: RevokeClean};
1752+
mode: ByRef(RevokeClean)};
17611753
let scratch = scratch_datum(bcx, binding_ty, false);
17621754
datum.copy_to_datum(bcx, INIT, scratch);
17631755
match binding_mode {

trunk/src/librustc/middle/trans/asm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ pub fn trans_inline_asm(bcx: block, ia: &ast::inline_asm) -> block {
9898

9999
// Add the clobbers to our constraints list
100100
if clobbers != ~"" && constraints != ~"" {
101-
constraints += ~"," + clobbers;
101+
constraints += ",";
102+
constraints += clobbers;
102103
} else {
103104
constraints += clobbers;
104105
}

trunk/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,8 +2906,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
29062906
let cstore = sess.cstore;
29072907
while cstore::have_crate_data(cstore, n_subcrates) { n_subcrates += 1; }
29082908
let mapname = if *sess.building_library {
2909-
mapmeta.name.to_owned() + "_" + mapmeta.vers.to_owned() + "_"
2910-
+ mapmeta.extras_hash.to_owned()
2909+
fmt!("%s_%s_%s", mapmeta.name, mapmeta.vers, mapmeta.extras_hash)
29112910
} else {
29122911
~"toplevel"
29132912
};

0 commit comments

Comments
 (0)