Skip to content

Commit be23f1e

Browse files
committed
---
yaml --- r: 65438 b: refs/heads/master c: 7f410b3 h: refs/heads/master v: v3
1 parent 5f718ea commit be23f1e

40 files changed

+323
-272
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: c492a2126fddb1b844ddee05a283a92329c6c041
2+
refs/heads/master: 7f410b326cef0939f581dcb7a469680b3c9c98b2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/configure

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,13 @@ then
970970
putvar CFG_CCACHE_CPP2
971971
fi
972972

973+
if [ ! -z "$CFG_ENABLE_CCACHE" ]
974+
then
975+
CFG_CCACHE_BASEDIR=${CFG_SRC_DIR}
976+
putvar CFG_CCACHE_BASEDIR
977+
fi
978+
979+
973980
if [ ! -z $BAD_PANDOC ]
974981
then
975982
CFG_PANDOC=

trunk/mk/platform.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@ ifeq ($(CFG_CCACHE_CPP2),1)
396396
export CCACHE_CPP
397397
endif
398398

399+
ifdef CFG_CCACHE_BASEDIR
400+
CCACHE_BASEDIR=$(CFG_CCACHE_BASEDIR)
401+
export CCACHE_BASEDIR
402+
endif
403+
399404
define CFG_MAKE_TOOLCHAIN
400405
CFG_COMPILE_C_$(1) = $$(CC_$(1)) \
401406
$$(CFG_GCCISH_CFLAGS) \

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-" + os::SYSNAME
102+
~"xfail-" + str::to_owned(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: 7 additions & 6 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(line) {
381+
if !was_expected && is_compiler_error_or_warning(str::to_owned(line)) {
382382
fatal_ProcRes(fmt!("unexpected compiler error or warning: '%s'",
383383
line),
384384
ProcRes);
@@ -596,7 +596,8 @@ 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() + os::EXE_SUFFIX)
599+
Path(output_base_name(config, testfile).to_str() +
600+
str::to_owned(os::EXE_SUFFIX))
600601
}
601602

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

608-
let mut args = toolargs + [make_exe_name(config, testfile).to_str()];
609+
let mut args = toolargs + ~[make_exe_name(config, testfile).to_str()];
609610
let prog = args.shift();
610611
return ProcArgs {prog: prog, args: args};
611612
}
@@ -654,7 +655,7 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[~str]) -> ~str {
654655
#[cfg(target_os = "win32")]
655656
fn make_cmdline(libpath: &str, prog: &str, args: &[~str]) -> ~str {
656657
fmt!("%s %s %s", lib_path_cmd_prefix(libpath), prog,
657-
str::connect(args, " "))
658+
str::connect(args, ~" "))
658659
}
659660
660661
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
@@ -775,8 +776,8 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
775776
for args.args.each |tv| {
776777
newcmd_out.push_str(" ");
777778
newcmd_err.push_str(" ");
778-
newcmd_out.push_str(*tv);
779-
newcmd_err.push_str(*tv);
779+
newcmd_out.push_str(tv.to_owned());
780+
newcmd_err.push_str(tv.to_owned());
780781
}
781782
782783
newcmd_out.push_str(" 2>/dev/null");

trunk/src/libextra/getopts.rs

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

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

120119
/// Create an option that is required and takes an argument
@@ -196,19 +195,19 @@ pub enum Fail_ {
196195
pub fn fail_str(f: Fail_) -> ~str {
197196
return match f {
198197
ArgumentMissing(ref nm) => {
199-
fmt!("Argument to option '%s' missing.", *nm)
198+
~"Argument to option '" + *nm + "' missing."
200199
}
201200
UnrecognizedOption(ref nm) => {
202-
fmt!("Unrecognized option: '%s'.", *nm)
201+
~"Unrecognized option: '" + *nm + "'."
203202
}
204203
OptionMissing(ref nm) => {
205-
fmt!("Required option '%s' missing.", *nm)
204+
~"Required option '" + *nm + "' missing."
206205
}
207206
OptionDuplicated(ref nm) => {
208-
fmt!("Option '%s' given more than once.", *nm)
207+
~"Option '" + *nm + "' given more than once."
209208
}
210209
UnexpectedArgument(ref nm) => {
211-
fmt!("Option '%s' does not take an argument.", *nm)
210+
~"Option " + *nm + " does not take an argument."
212211
}
213212
};
214213
}
@@ -246,11 +245,11 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result {
246245
let mut names;
247246
let mut i_arg = None;
248247
if cur[1] == '-' as u8 {
249-
let tail = str::slice(cur, 2, curlen);
248+
let tail = str::slice(cur, 2, curlen).to_owned();
250249
let mut tail_eq = ~[];
251250
for str::each_splitn_char(tail, '=', 1) |s| { tail_eq.push(s.to_owned()) }
252251
if tail_eq.len() <= 1 {
253-
names = ~[Long(tail.to_owned())];
252+
names = ~[Long(tail)];
254253
} else {
255254
names =
256255
~[Long(copy tail_eq[0])];

trunk/src/libextra/net_ip.rs

Lines changed: 3 additions & 2 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(ip, 22);
233+
let new_addr = uv_ip4_addr(str::to_owned(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,6 +259,7 @@ pub mod v6 {
259259
use uv_ip6_name = uv::ll::ip6_name;
260260

261261
use core::result;
262+
use core::str;
262263

263264
/**
264265
* Convert a str to `ip_addr`
@@ -284,7 +285,7 @@ pub mod v6 {
284285
pub fn try_parse_addr(ip: &str) -> result::Result<IpAddr,ParseAddrErr> {
285286
unsafe {
286287
// need to figure out how to establish a parse failure..
287-
let new_addr = uv_ip6_addr(ip, 22);
288+
let new_addr = uv_ip6_addr(str::to_owned(ip), 22);
288289
let reparsed_name = uv_ip6_name(&new_addr);
289290
debug!("v6::try_parse_addr ip: '%s' reparsed '%s'",
290291
ip, reparsed_name);

trunk/src/libextra/net_url.rs

Lines changed: 4 additions & 3 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)),
588+
return Ok((decode_component(str::slice(rawurl, 0, end).to_owned()),
589589
str::slice(rawurl, end, len).to_owned()));
590590
}
591591

@@ -596,13 +596,14 @@ 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)));
599+
str::len(rawurl)).to_owned());
600600
return Ok((~[], Some(f)));
601601
} else {
602602
return Ok((~[], None));
603603
}
604604
}
605-
let (q, r) = split_char_first(str::slice(rawurl, 1, rawurl.len()), '#');
605+
let (q, r) = split_char_first(str::slice(rawurl, 1,
606+
str::len(rawurl)).to_owned(), '#');
606607
let f = if str::len(r) != 0 {
607608
Some(decode_component(r)) } else { None };
608609
return Ok((query_from_str(q), f));

trunk/src/libextra/sha1.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ mod tests {
399399
let mut left = len;
400400
while left > 0u {
401401
let take = (left + 1u) / 2u;
402-
sh.input_str(t.input.slice(len - left, take + len - left));
402+
sh.input_str(str::slice(t.input, len - left,
403+
take + len - left).to_owned());
403404
left = left - take;
404405
}
405406
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(ss, pos);
296+
let range = str::char_range_at(str::to_owned(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(format) |rdr| {
635+
do io::with_str_reader(str::to_owned(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(format) |rdr| {
847+
do io::with_str_reader(str::to_owned(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);
204+
io::println(~"workcache: " + i.to_owned());
205205
}
206206
}
207207

trunk/src/librustc/back/link.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,14 +741,16 @@ 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);
744745
let (dll_prefix, dll_suffix) = match os {
745746
session::os_win32 => (win32::DLL_PREFIX, win32::DLL_SUFFIX),
746747
session::os_macos => (macos::DLL_PREFIX, macos::DLL_SUFFIX),
747748
session::os_linux => (linux::DLL_PREFIX, linux::DLL_SUFFIX),
748749
session::os_android => (android::DLL_PREFIX, android::DLL_SUFFIX),
749750
session::os_freebsd => (freebsd::DLL_PREFIX, freebsd::DLL_SUFFIX),
750751
};
751-
fmt!("%s%s-%s-%s%s", dll_prefix, lm.name, lm.extras_hash, lm.vers, dll_suffix)
752+
return str::to_owned(dll_prefix) + libname +
753+
str::to_owned(dll_suffix);
752754
}
753755

754756
// 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);
2017+
s += type_to_str_inner(names, outer, *t).to_owned();
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ 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(fmt!("could not find metadata in %s.\n", path.to_str()))
271+
out.write_str(~"could not find metadata in "
272+
+ path.to_str() + ".\n");
272273
}
273274
}
274275
}

trunk/src/librustc/metadata/tyencode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ 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 = fmt!("#%x:%x#", pos, len);
92+
let s = ~"#" + uint::to_str_radix(pos, 16u) + ":" +
93+
uint::to_str_radix(len, 16u) + "#";
9394
let a = ty_abbrev { pos: pos, len: len, s: @s };
9495
abbrevs.insert(t, a);
9596
}

0 commit comments

Comments
 (0)