Skip to content

Commit 8ce1e08

Browse files
committed
---
yaml --- r: 114158 b: refs/heads/master c: f2c4c88 h: refs/heads/master v: v3
1 parent 3a6edaf commit 8ce1e08

File tree

290 files changed

+3890
-2047
lines changed

Some content is hidden

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

290 files changed

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

trunk/man/rustc.1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ 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
144141
\fBno-rpath\fR
145142
If specified, then the rpath value for dynamic libraries will not be set in
146143
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 :=-C android-cross-path=$(CFG_ANDROID_CROSS_PATH)
310+
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=
311311

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

trunk/mk/tests.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ 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) \
604605
--adb-path=$(CFG_ADB) \
605606
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
606607
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \

trunk/src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ 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+
129132
// Extra parameter to run adb on arm-linux-androideabi
130133
pub adb_path: ~str,
131134

trunk/src/compiletest/compiletest.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ 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"),
8283
optopt("", "adb-path", "path to the android debugger", "PATH"),
8384
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
8485
optopt("", "lldb-python-dir", "directory containing LLDB's python module", "PATH"),
@@ -142,6 +143,7 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
142143
jit: matches.opt_present("jit"),
143144
target: opt_str2(matches.opt_str("target")).to_str(),
144145
host: opt_str2(matches.opt_str("host")).to_str(),
146+
android_cross_path: opt_path(matches, "android-cross-path"),
145147
adb_path: opt_str2(matches.opt_str("adb-path")).to_str(),
146148
adb_test_dir:
147149
opt_str2(matches.opt_str("adb-test-dir")).to_str(),
@@ -150,7 +152,8 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
150152
"(none)" != opt_str2(matches.opt_str("adb-test-dir")) &&
151153
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
152154
lldb_python_dir: matches.opt_str("lldb-python-dir"),
153-
test_shard: test::opt_shard(matches.opt_str("test-shard")),
155+
test_shard: test::opt_shard(matches.opt_str("test-shard")
156+
.map(|x| x.to_strbuf())),
154157
verbose: matches.opt_present("verbose")
155158
}
156159
}
@@ -173,6 +176,7 @@ pub fn log_config(config: &Config) {
173176
logv(c, format!("jit: {}", config.jit));
174177
logv(c, format!("target: {}", config.target));
175178
logv(c, format!("host: {}", config.host));
179+
logv(c, format!("android-cross-path: {}", config.android_cross_path.display()));
176180
logv(c, format!("adb_path: {}", config.adb_path));
177181
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
178182
logv(c, format!("adb_device_status: {}", config.adb_device_status));
@@ -232,7 +236,10 @@ pub fn run_tests(config: &Config) {
232236

233237
pub fn test_opts(config: &Config) -> test::TestOpts {
234238
test::TestOpts {
235-
filter: config.filter.clone(),
239+
filter: match config.filter {
240+
None => None,
241+
Some(ref filter) => Some(filter.to_strbuf()),
242+
},
236243
run_ignored: config.run_ignored,
237244
logfile: config.logfile.clone(),
238245
run_tests: true,
@@ -311,7 +318,9 @@ pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
311318
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
312319
}
313320

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

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

trunk/src/compiletest/runtest.rs

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

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-
}
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+
};
362354

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

trunk/src/etc/zsh/_rust

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ 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]'
98
--ar'[Program to use for managing archives instead of the default.]'
109
-c'[Compile and assemble, but do not link]'
1110
--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: ~str,
533+
string: StrBuf,
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_owned(),
542+
string: "hello world".to_strbuf(),
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_owned(),
553+
string: "hello world".to_strbuf(),
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_owned(),
563+
string: "hello world".to_strbuf(),
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_owned(),
574+
string: "hello world".to_strbuf(),
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 = 0;
1909+
let mut observed: u32 = 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 = 0;
2105+
let mut observed: u32 = 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<~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]);
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]);
277277
assert_eq!(cache.len(), 1);
278278
}
279279

280280
#[test]
281281
fn test_expire_lru() {
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());
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());
290290
}
291291

292292
#[test]

trunk/src/libcore/cmp.rs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 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,6 +217,29 @@ 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+
220243
// @ pointers
221244
impl<T:Eq> Eq for @T {
222245
#[inline]
@@ -254,6 +277,15 @@ mod test {
254277
assert_eq!(12u.cmp(-5), Greater);
255278
}
256279

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+
257289
#[test]
258290
fn test_ordering_order() {
259291
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) -> ~str {
313+
pub fn escape(s: &str) -> StrBuf {
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.into_owned()
328+
escaped
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_owned());
771-
assert!(Pattern::new(Pattern::escape(s)).matches(s));
770+
assert_eq!(Pattern::escape(s), "_[[]_[]]_[?]_[*]_!_".to_strbuf());
771+
assert!(Pattern::new(Pattern::escape(s).as_slice()).matches(s));
772772
}
773773

774774
#[test]

trunk/src/libgraphviz/lib.rs

Lines changed: 8 additions & 5 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) -> ~str {
436+
pub fn escape(&self) -> StrBuf {
437437
match self {
438-
&LabelStr(ref s) => s.as_slice().escape_default(),
439-
&EscStr(ref s) => LabelText::escape_str(s.as_slice()).into_owned(),
438+
&LabelStr(ref s) => s.as_slice().escape_default().to_strbuf(),
439+
&EscStr(ref s) => LabelText::escape_str(s.as_slice()).to_strbuf(),
440440
}
441441
}
442442
}
@@ -661,11 +661,14 @@ mod tests {
661661
}
662662
}
663663

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

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

trunk/src/libhexfloat/lib.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,39 @@ 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, ~str)> {
73+
fn hex_float_lit_err(s: &str) -> Option<(uint, StrBuf)> {
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') { return Some((i, "Expected '0'".to_owned())); } i+=1;
78-
if chars.next() != Some('x') { return Some((i, "Expected 'x'".to_owned())); } 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;
7983
let mut d_len = 0;
8084
for _ in chars.take_while(|c| c.is_digit_radix(16)) { chars.next(); i+=1; d_len += 1;}
81-
if chars.next() != Some('.') { return Some((i, "Expected '.'".to_owned())); } i+=1;
85+
if chars.next() != Some('.') {
86+
return Some((i, "Expected '.'".to_strbuf()));
87+
} i+=1;
8288
let mut f_len = 0;
8389
for _ in chars.take_while(|c| c.is_digit_radix(16)) { chars.next(); i+=1; f_len += 1;}
8490
if d_len == 0 && f_len == 0 {
85-
return Some((i, "Expected digits before or after decimal point".to_owned()));
91+
return Some((i, "Expected digits before or after decimal \
92+
point".to_strbuf()));
8693
}
87-
if chars.next() != Some('p') { return Some((i, "Expected 'p'".to_owned())); } i+=1;
94+
if chars.next() != Some('p') {
95+
return Some((i, "Expected 'p'".to_strbuf()));
96+
} i+=1;
8897
if chars.peek() == Some(&'-') { chars.next(); i+= 1 }
8998
let mut e_len = 0;
9099
for _ in chars.take_while(|c| c.is_digit()) { chars.next(); i+=1; e_len += 1}
91100
if e_len == 0 {
92-
return Some((i, "Expected exponent digits".to_owned()));
101+
return Some((i, "Expected exponent digits".to_strbuf()));
93102
}
94103
match chars.next() {
95104
None => None,
96-
Some(_) => Some((i, "Expected end of string".to_owned()))
105+
Some(_) => Some((i, "Expected end of string".to_strbuf()))
97106
}
98107
}
99108

0 commit comments

Comments
 (0)