Skip to content

Commit 3a6edaf

Browse files
committed
---
yaml --- r: 114157 b: refs/heads/master c: f853cf7 h: refs/heads/master i: 114155: 943df8f v: v3
1 parent 9250e5d commit 3a6edaf

File tree

291 files changed

+2052
-3890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+2052
-3890
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: fedffa785eb1def61d012e8e614d562afaf19a6e
2+
refs/heads/master: f853cf79b568fdffe83729aad4a43cb3c9ff3c92
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17

trunk/man/rustc.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ A space-separated list of arguments to pass through to LLVM.
138138
If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
139139
throughout compilation in the output directory.
140140
.TP
141+
\fBandroid-cross-path\fR=path/to/ndk/bin
142+
Directory to find the Android NDK cross-compilation tools
143+
.TP
141144
\fBno-rpath\fR
142145
If specified, then the rpath value for dynamic libraries will not be set in
143146
either dynamic library or executable outputs.

trunk/mk/platform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ CFG_LDPATH_arm-linux-androideabi :=
307307
CFG_RUN_arm-linux-androideabi=
308308
CFG_RUN_TARG_arm-linux-androideabi=
309309
RUSTC_FLAGS_arm-linux-androideabi :=
310-
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=
310+
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=-C android-cross-path=$(CFG_ANDROID_CROSS_PATH)
311311

312312
# arm-unknown-linux-gnueabihf configuration
313313
CROSS_PREFIX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-

trunk/mk/tests.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
601601
--stage-id stage$(1)-$(2) \
602602
--target $(2) \
603603
--host $(3) \
604-
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
605604
--adb-path=$(CFG_ADB) \
606605
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
607606
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \

trunk/src/compiletest/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ pub struct Config {
126126
// Host triple for the compiler being invoked
127127
pub host: ~str,
128128

129-
// Path to the android tools
130-
pub android_cross_path: Path,
131-
132129
// Extra parameter to run adb on arm-linux-androideabi
133130
pub adb_path: ~str,
134131

trunk/src/compiletest/compiletest.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
7979
optflag("", "jit", "run tests under the JIT"),
8080
optopt("", "target", "the target to build for", "TARGET"),
8181
optopt("", "host", "the host to build for", "HOST"),
82-
optopt("", "android-cross-path", "Android NDK standalone path", "PATH"),
8382
optopt("", "adb-path", "path to the android debugger", "PATH"),
8483
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
8584
optopt("", "lldb-python-dir", "directory containing LLDB's python module", "PATH"),
@@ -143,7 +142,6 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
143142
jit: matches.opt_present("jit"),
144143
target: opt_str2(matches.opt_str("target")).to_str(),
145144
host: opt_str2(matches.opt_str("host")).to_str(),
146-
android_cross_path: opt_path(matches, "android-cross-path"),
147145
adb_path: opt_str2(matches.opt_str("adb-path")).to_str(),
148146
adb_test_dir:
149147
opt_str2(matches.opt_str("adb-test-dir")).to_str(),
@@ -152,8 +150,7 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
152150
"(none)" != opt_str2(matches.opt_str("adb-test-dir")) &&
153151
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
154152
lldb_python_dir: matches.opt_str("lldb-python-dir"),
155-
test_shard: test::opt_shard(matches.opt_str("test-shard")
156-
.map(|x| x.to_strbuf())),
153+
test_shard: test::opt_shard(matches.opt_str("test-shard")),
157154
verbose: matches.opt_present("verbose")
158155
}
159156
}
@@ -176,7 +173,6 @@ pub fn log_config(config: &Config) {
176173
logv(c, format!("jit: {}", config.jit));
177174
logv(c, format!("target: {}", config.target));
178175
logv(c, format!("host: {}", config.host));
179-
logv(c, format!("android-cross-path: {}", config.android_cross_path.display()));
180176
logv(c, format!("adb_path: {}", config.adb_path));
181177
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
182178
logv(c, format!("adb_device_status: {}", config.adb_device_status));
@@ -236,10 +232,7 @@ pub fn run_tests(config: &Config) {
236232

237233
pub fn test_opts(config: &Config) -> test::TestOpts {
238234
test::TestOpts {
239-
filter: match config.filter {
240-
None => None,
241-
Some(ref filter) => Some(filter.to_strbuf()),
242-
},
235+
filter: config.filter.clone(),
243236
run_ignored: config.run_ignored,
244237
logfile: config.logfile.clone(),
245238
run_tests: true,
@@ -318,9 +311,7 @@ pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
318311
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
319312
}
320313

321-
test::DynTestName(format_strbuf!("[{}] {}",
322-
config.mode,
323-
shorten(testfile)))
314+
test::DynTestName(format!("[{}] {}", config.mode, shorten(testfile)))
324315
}
325316

326317
pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {

trunk/src/compiletest/runtest.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,18 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
347347
break;
348348
}
349349

350-
let tool_path = match config.android_cross_path.as_str() {
351-
Some(x) => x.to_strbuf(),
352-
None => fatal("cannot find android cross path".to_owned())
353-
};
350+
let args = split_maybe_args(&config.target_rustcflags);
351+
let mut tool_path = StrBuf::new();
352+
for arg in args.iter() {
353+
if arg.contains("android-cross-path=") {
354+
tool_path = StrBuf::from_str(arg.replace("android-cross-path=", ""));
355+
break;
356+
}
357+
}
358+
359+
if tool_path.is_empty() {
360+
fatal("cannot found android cross path".to_owned());
361+
}
354362

355363
let debugger_script = make_out_name(config, testfile, "debugger.script");
356364
// FIXME (#9639): This needs to handle non-utf8 paths

trunk/src/etc/zsh/_rust

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local -a _rustc_opts_switches _rustc_opts_lint _rustc_opts_debug
55
typeset -A opt_args
66

77
_rustc_opts_switches=(
8+
--android-cross-path'[The path to the Android NDK]'
89
--ar'[Program to use for managing archives instead of the default.]'
910
-c'[Compile and assemble, but do not link]'
1011
--cfg'[Configure the compilation environment]'

trunk/src/libarena/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ mod tests {
530530
}
531531

532532
struct Noncopy {
533-
string: StrBuf,
533+
string: ~str,
534534
array: Vec<int> ,
535535
}
536536

@@ -539,7 +539,7 @@ mod tests {
539539
let arena = TypedArena::new();
540540
for _ in range(0, 100000) {
541541
arena.alloc(Noncopy {
542-
string: "hello world".to_strbuf(),
542+
string: "hello world".to_owned(),
543543
array: vec!( 1, 2, 3, 4, 5 ),
544544
});
545545
}
@@ -550,7 +550,7 @@ mod tests {
550550
let arena = TypedArena::new();
551551
b.iter(|| {
552552
arena.alloc(Noncopy {
553-
string: "hello world".to_strbuf(),
553+
string: "hello world".to_owned(),
554554
array: vec!( 1, 2, 3, 4, 5 ),
555555
})
556556
})
@@ -560,7 +560,7 @@ mod tests {
560560
pub fn bench_noncopy_nonarena(b: &mut Bencher) {
561561
b.iter(|| {
562562
box Noncopy {
563-
string: "hello world".to_strbuf(),
563+
string: "hello world".to_owned(),
564564
array: vec!( 1, 2, 3, 4, 5 ),
565565
}
566566
})
@@ -571,7 +571,7 @@ mod tests {
571571
let arena = Arena::new();
572572
b.iter(|| {
573573
arena.alloc(|| Noncopy {
574-
string: "hello world".to_strbuf(),
574+
string: "hello world".to_owned(),
575575
array: vec!( 1, 2, 3, 4, 5 ),
576576
})
577577
})

trunk/src/libcollections/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ mod test_map {
19061906
}
19071907
assert_eq!(m.len(), 32);
19081908

1909-
let mut observed: u32 = 0;
1909+
let mut observed = 0;
19101910

19111911
for (k, v) in m.iter() {
19121912
assert_eq!(*v, *k * 2);
@@ -2102,7 +2102,7 @@ mod test_set {
21022102
for i in range(0u, 32) {
21032103
assert!(a.insert(i));
21042104
}
2105-
let mut observed: u32 = 0;
2105+
let mut observed = 0;
21062106
for k in a.iter() {
21072107
observed |= 1 << *k;
21082108
}

trunk/src/libcollections/lru_cache.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,23 +270,23 @@ mod tests {
270270

271271
#[test]
272272
fn test_put_update() {
273-
let mut cache: LruCache<StrBuf, Vec<u8>> = LruCache::new(1);
274-
cache.put("1".to_strbuf(), vec![10, 10]);
275-
cache.put("1".to_strbuf(), vec![10, 19]);
276-
assert_opt_eq(cache.get(&"1".to_strbuf()), vec![10, 19]);
273+
let mut cache: LruCache<~str, Vec<u8>> = LruCache::new(1);
274+
cache.put("1".to_owned(), vec![10, 10]);
275+
cache.put("1".to_owned(), vec![10, 19]);
276+
assert_opt_eq(cache.get(&"1".to_owned()), vec![10, 19]);
277277
assert_eq!(cache.len(), 1);
278278
}
279279

280280
#[test]
281281
fn test_expire_lru() {
282-
let mut cache: LruCache<StrBuf, StrBuf> = LruCache::new(2);
283-
cache.put("foo1".to_strbuf(), "bar1".to_strbuf());
284-
cache.put("foo2".to_strbuf(), "bar2".to_strbuf());
285-
cache.put("foo3".to_strbuf(), "bar3".to_strbuf());
286-
assert!(cache.get(&"foo1".to_strbuf()).is_none());
287-
cache.put("foo2".to_strbuf(), "bar2update".to_strbuf());
288-
cache.put("foo4".to_strbuf(), "bar4".to_strbuf());
289-
assert!(cache.get(&"foo3".to_strbuf()).is_none());
282+
let mut cache: LruCache<~str, ~str> = LruCache::new(2);
283+
cache.put("foo1".to_owned(), "bar1".to_owned());
284+
cache.put("foo2".to_owned(), "bar2".to_owned());
285+
cache.put("foo3".to_owned(), "bar3".to_owned());
286+
assert!(cache.get(&"foo1".to_owned()).is_none());
287+
cache.put("foo2".to_owned(), "bar2update".to_owned());
288+
cache.put("foo4".to_owned(), "bar4".to_owned());
289+
assert!(cache.get(&"foo3".to_owned()).is_none());
290290
}
291291

292292
#[test]

trunk/src/libcore/cmp.rs

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -217,29 +217,6 @@ mod impls {
217217
}
218218
impl<'a, T: TotalEq> TotalEq for &'a T {}
219219

220-
// &mut pointers
221-
impl<'a, T: Eq> Eq for &'a mut T {
222-
#[inline]
223-
fn eq(&self, other: &&'a mut T) -> bool { **self == *(*other) }
224-
#[inline]
225-
fn ne(&self, other: &&'a mut T) -> bool { **self != *(*other) }
226-
}
227-
impl<'a, T: Ord> Ord for &'a mut T {
228-
#[inline]
229-
fn lt(&self, other: &&'a mut T) -> bool { **self < **other }
230-
#[inline]
231-
fn le(&self, other: &&'a mut T) -> bool { **self <= **other }
232-
#[inline]
233-
fn ge(&self, other: &&'a mut T) -> bool { **self >= **other }
234-
#[inline]
235-
fn gt(&self, other: &&'a mut T) -> bool { **self > **other }
236-
}
237-
impl<'a, T: TotalOrd> TotalOrd for &'a mut T {
238-
#[inline]
239-
fn cmp(&self, other: &&'a mut T) -> Ordering { (**self).cmp(*other) }
240-
}
241-
impl<'a, T: TotalEq> TotalEq for &'a mut T {}
242-
243220
// @ pointers
244221
impl<T:Eq> Eq for @T {
245222
#[inline]
@@ -277,15 +254,6 @@ mod test {
277254
assert_eq!(12u.cmp(-5), Greater);
278255
}
279256

280-
#[test]
281-
fn test_mut_int_totalord() {
282-
assert_eq!((&mut 5u).cmp(&10), Less);
283-
assert_eq!((&mut 10u).cmp(&5), Greater);
284-
assert_eq!((&mut 5u).cmp(&5), Equal);
285-
assert_eq!((&mut -5u).cmp(&12), Less);
286-
assert_eq!((&mut 12u).cmp(-5), Greater);
287-
}
288-
289257
#[test]
290258
fn test_ordering_order() {
291259
assert!(Less < Equal);

trunk/src/libglob/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl Pattern {
310310
* brackets. The resulting string will, when compiled into a `Pattern`,
311311
* match the input string and nothing else.
312312
*/
313-
pub fn escape(s: &str) -> StrBuf {
313+
pub fn escape(s: &str) -> ~str {
314314
let mut escaped = StrBuf::new();
315315
for c in s.chars() {
316316
match c {
@@ -325,7 +325,7 @@ impl Pattern {
325325
}
326326
}
327327
}
328-
escaped
328+
escaped.into_owned()
329329
}
330330

331331
/**
@@ -767,8 +767,8 @@ mod test {
767767
#[test]
768768
fn test_pattern_escape() {
769769
let s = "_[_]_?_*_!_";
770-
assert_eq!(Pattern::escape(s), "_[[]_[]]_[?]_[*]_!_".to_strbuf());
771-
assert!(Pattern::new(Pattern::escape(s).as_slice()).matches(s));
770+
assert_eq!(Pattern::escape(s), "_[[]_[]]_[?]_[*]_!_".to_owned());
771+
assert!(Pattern::new(Pattern::escape(s)).matches(s));
772772
}
773773

774774
#[test]

trunk/src/libgraphviz/lib.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ impl<'a> LabelText<'a> {
433433
}
434434

435435
/// Renders text as string suitable for a label in a .dot file.
436-
pub fn escape(&self) -> StrBuf {
436+
pub fn escape(&self) -> ~str {
437437
match self {
438-
&LabelStr(ref s) => s.as_slice().escape_default().to_strbuf(),
439-
&EscStr(ref s) => LabelText::escape_str(s.as_slice()).to_strbuf(),
438+
&LabelStr(ref s) => s.as_slice().escape_default(),
439+
&EscStr(ref s) => LabelText::escape_str(s.as_slice()).into_owned(),
440440
}
441441
}
442442
}
@@ -661,14 +661,11 @@ mod tests {
661661
}
662662
}
663663

664-
fn test_input(g: LabelledGraph) -> IoResult<StrBuf> {
664+
fn test_input(g: LabelledGraph) -> IoResult<~str> {
665665
let mut writer = MemWriter::new();
666666
render(&g, &mut writer).unwrap();
667667
let mut r = BufReader::new(writer.get_ref());
668-
match r.read_to_str() {
669-
Ok(string) => Ok(string.to_strbuf()),
670-
Err(err) => Err(err),
671-
}
668+
r.read_to_str()
672669
}
673670

674671
// All of the tests use raw-strings as the format for the expected outputs,

trunk/src/libhexfloat/lib.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,39 +70,30 @@ pub fn macro_registrar(register: |Name, SyntaxExtension|) {
7070

7171
//Check if the literal is valid (as LLVM expects),
7272
//and return a descriptive error if not.
73-
fn hex_float_lit_err(s: &str) -> Option<(uint, StrBuf)> {
73+
fn hex_float_lit_err(s: &str) -> Option<(uint, ~str)> {
7474
let mut chars = s.chars().peekable();
7575
let mut i = 0;
7676
if chars.peek() == Some(&'-') { chars.next(); i+= 1 }
77-
if chars.next() != Some('0') {
78-
return Some((i, "Expected '0'".to_strbuf()));
79-
} i+=1;
80-
if chars.next() != Some('x') {
81-
return Some((i, "Expected 'x'".to_strbuf()));
82-
} i+=1;
77+
if chars.next() != Some('0') { return Some((i, "Expected '0'".to_owned())); } i+=1;
78+
if chars.next() != Some('x') { return Some((i, "Expected 'x'".to_owned())); } i+=1;
8379
let mut d_len = 0;
8480
for _ in chars.take_while(|c| c.is_digit_radix(16)) { chars.next(); i+=1; d_len += 1;}
85-
if chars.next() != Some('.') {
86-
return Some((i, "Expected '.'".to_strbuf()));
87-
} i+=1;
81+
if chars.next() != Some('.') { return Some((i, "Expected '.'".to_owned())); } i+=1;
8882
let mut f_len = 0;
8983
for _ in chars.take_while(|c| c.is_digit_radix(16)) { chars.next(); i+=1; f_len += 1;}
9084
if d_len == 0 && f_len == 0 {
91-
return Some((i, "Expected digits before or after decimal \
92-
point".to_strbuf()));
85+
return Some((i, "Expected digits before or after decimal point".to_owned()));
9386
}
94-
if chars.next() != Some('p') {
95-
return Some((i, "Expected 'p'".to_strbuf()));
96-
} i+=1;
87+
if chars.next() != Some('p') { return Some((i, "Expected 'p'".to_owned())); } i+=1;
9788
if chars.peek() == Some(&'-') { chars.next(); i+= 1 }
9889
let mut e_len = 0;
9990
for _ in chars.take_while(|c| c.is_digit()) { chars.next(); i+=1; e_len += 1}
10091
if e_len == 0 {
101-
return Some((i, "Expected exponent digits".to_strbuf()));
92+
return Some((i, "Expected exponent digits".to_owned()));
10293
}
10394
match chars.next() {
10495
None => None,
105-
Some(_) => Some((i, "Expected end of string".to_strbuf()))
96+
Some(_) => Some((i, "Expected end of string".to_owned()))
10697
}
10798
}
10899

0 commit comments

Comments
 (0)