Skip to content

Commit ea123f4

Browse files
committed
---
yaml --- r: 143231 b: refs/heads/try2 c: 172ea83 h: refs/heads/master i: 143229: dd59860 143227: 0e6701c 143223: f99f995 143215: 1ccb8d3 143199: 2645716 143167: 56447fa 143103: 46b113f v: v3
1 parent 574dcb6 commit ea123f4

File tree

166 files changed

+1095
-1611
lines changed

Some content is hidden

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

166 files changed

+1095
-1611
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b30a16c9aefbc568f67c8121f170b6d478102c5f
8+
refs/heads/try2: 172ea83adc1e97d1f2fbe72326d1381bf80760bd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial-container.md

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,15 @@ let mut it = xs.iter().zip(ys.iter());
192192

193193
// print out the pairs of elements up to (&3, &"baz")
194194
for it.advance |(x, y)| {
195-
printfln!("%d %s", *x, *y);
195+
println(fmt!("%d %s", *x, *y));
196196

197197
if *x == 3 {
198198
break;
199199
}
200200
}
201201

202202
// yield and print the last pair from the iterator
203-
printfln!("last: %?", it.next());
203+
println(fmt!("last: %?", it.next()));
204204

205205
// the iterator is now fully consumed
206206
assert!(it.next().is_none());
@@ -294,59 +294,15 @@ another `DoubleEndedIterator` with `next` and `next_back` exchanged.
294294
~~~
295295
let xs = [1, 2, 3, 4, 5, 6];
296296
let mut it = xs.iter();
297-
printfln!("%?", it.next()); // prints `Some(&1)`
298-
printfln!("%?", it.next()); // prints `Some(&2)`
299-
printfln!("%?", it.next_back()); // prints `Some(&6)`
297+
println(fmt!("%?", it.next())); // prints `Some(&1)`
298+
println(fmt!("%?", it.next())); // prints `Some(&2)`
299+
println(fmt!("%?", it.next_back())); // prints `Some(&6)`
300300

301301
// prints `5`, `4` and `3`
302302
for it.invert().advance |&x| {
303-
printfln!("%?", x)
303+
println(fmt!("%?", x))
304304
}
305305
~~~
306306
307307
The `rev_iter` and `mut_rev_iter` methods on vectors just return an inverted
308308
version of the standard immutable and mutable vector iterators.
309-
310-
The `chain_`, `transform`, `filter`, `filter_map` and `peek` adaptors are
311-
`DoubleEndedIterator` implementations if the underlying iterators are.
312-
313-
~~~
314-
let xs = [1, 2, 3, 4];
315-
let ys = [5, 6, 7, 8];
316-
let mut it = xs.iter().chain_(ys.iter()).transform(|&x| x * 2);
317-
318-
printfln!("%?", it.next()); // prints `Some(2)`
319-
320-
// prints `16`, `14`, `12`, `10`, `8`, `6`, `4`
321-
for it.invert().advance |x| {
322-
printfln!("%?", x);
323-
}
324-
~~~
325-
326-
## Random-access iterators
327-
328-
The `RandomAccessIterator` trait represents an iterator offering random access
329-
to the whole range. The `indexable` method retrieves the number of elements
330-
accessible with the `idx` method.
331-
332-
The `chain_` adaptor is an implementation of `RandomAccessIterator` if the
333-
underlying iterators are.
334-
335-
~~~
336-
let xs = [1, 2, 3, 4, 5];
337-
let ys = ~[7, 9, 11];
338-
let mut it = xs.iter().chain_(ys.iter());
339-
printfln!("%?", it.idx(0)); // prints `Some(&1)`
340-
printfln!("%?", it.idx(5)); // prints `Some(&7)`
341-
printfln!("%?", it.idx(7)); // prints `Some(&11)`
342-
printfln!("%?", it.idx(8)); // prints `None`
343-
344-
// yield two elements from the beginning, and one from the end
345-
it.next();
346-
it.next();
347-
it.next_back();
348-
349-
printfln!("%?", it.idx(0)); // prints `Some(&3)`
350-
printfln!("%?", it.idx(4)); // prints `Some(&9)`
351-
printfln!("%?", it.idx(6)); // prints `None`
352-
~~~

branches/try2/mk/tests.mk

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,6 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
537537

538538
# Rules for the cfail/rfail/rpass/bench/perf test runner
539539

540-
# The tests select when to use debug configuration on their own;
541-
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
542-
CTEST_RUSTC_FLAGS = $$(subst --cfg debug,,$$(CFG_RUSTC_FLAGS))
543-
544540
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
545541
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
546542
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
@@ -552,7 +548,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
552548
--target $(2) \
553549
--adb-path=$(CFG_ADB) \
554550
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
555-
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) --target=$(2)" \
551+
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \
556552
$$(CTEST_TESTARGS)
557553

558554
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
292292
}
293293
}
294294
if i != num_check_lines {
295-
fatal_ProcRes(fmt!("line not found in debugger output: %s",
295+
fatal_ProcRes(fmt!("line not found in debugger output: %s"
296296
check_lines[i]), &ProcRes);
297297
}
298298
}

branches/try2/src/etc/emacs/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,3 @@ marking, press x, and ELPA will install the packages for you (under
9898
~/.emacs.d/elpa/).
9999

100100
* or using <kbd>M-x package-install rust-mode
101-
102-
### Known bugs
103-
104-
* Combining `global-whitespace-mode` and `rust-mode` is generally glitchy.
105-
See [Issue #3994](https://github.com/mozilla/rust/issues/3994).

branches/try2/src/etc/tidy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def do_license_check(name, contents):
4949
report_err("FIXME without issue number")
5050
if line.find("TODO") != -1:
5151
report_err("TODO is deprecated; use FIXME")
52-
match = re.match(r'^.*//\s*(NOTE.*)$', line)
53-
if match:
54-
report_warn(match.group(1))
52+
idx = line.find("// NOTE")
53+
if idx != -1:
54+
report_warn("NOTE" + line[idx + len("// NOTE"):])
5555
if (line.find('\t') != -1 and
5656
fileinput.filename().find("Makefile") == -1):
5757
report_err("tab character")

branches/try2/src/libextra/base64.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<'self> ToBase64 for &'self [u8] {
7575
*
7676
* fn main () {
7777
* let str = [52,32].to_base64(standard);
78-
* printfln!("%s", str);
78+
* println(fmt!("%s", str));
7979
* }
8080
* ~~~
8181
*/
@@ -164,7 +164,7 @@ impl<'self> ToBase64 for &'self str {
164164
*
165165
* fn main () {
166166
* let str = "Hello, World".to_base64(standard);
167-
* printfln!("%s", str);
167+
* println(fmt!("%s",str));
168168
* }
169169
* ~~~
170170
*
@@ -194,9 +194,9 @@ impl<'self> FromBase64 for &'self [u8] {
194194
*
195195
* fn main () {
196196
* let str = [52,32].to_base64(standard);
197-
* printfln!("%s", str);
197+
* println(fmt!("%s", str));
198198
* let bytes = str.from_base64();
199-
* printfln!("%?", bytes);
199+
* println(fmt!("%?",bytes));
200200
* }
201201
* ~~~
202202
*/
@@ -271,11 +271,11 @@ impl<'self> FromBase64 for &'self str {
271271
*
272272
* fn main () {
273273
* let hello_str = "Hello, World".to_base64(standard);
274-
* printfln!("%s", hello_str);
274+
* println(fmt!("%s",hello_str));
275275
* let bytes = hello_str.from_base64();
276-
* printfln!("%?", bytes);
276+
* println(fmt!("%?",bytes));
277277
* let result_str = str::from_bytes(bytes);
278-
* printfln!("%s", result_str);
278+
* println(fmt!("%s",result_str));
279279
* }
280280
* ~~~
281281
*/

branches/try2/src/libextra/future.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* # fn make_a_sandwich() {};
2020
* let mut delayed_fib = extra::future::spawn (|| fib(5000) );
2121
* make_a_sandwich();
22-
* printfln!("fib(5000) = %?", delayed_fib.get())
22+
* println(fmt!("fib(5000) = %?", delayed_fib.get()))
2323
* ~~~
2424
*/
2525

@@ -194,7 +194,7 @@ mod test {
194194
195195
#[test]
196196
fn test_interface_unwrap() {
197-
let f = from_value(~"fail");
197+
let mut f = from_value(~"fail");
198198
assert_eq!(f.unwrap(), ~"fail");
199199
}
200200

branches/try2/src/libextra/getopts.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* }
4545
*
4646
* fn print_usage(program: &str, _opts: &[Opt]) {
47-
* printfln!("Usage: %s [options]", program);
47+
* println(fmt!("Usage: %s [options]", program));
4848
* println("-o\t\tOutput");
4949
* println("-h --help\tUsage");
5050
* }
@@ -457,7 +457,7 @@ pub fn opt_default(mm: &Matches, nm: &str, def: &str) -> Option<~str> {
457457
let vals = opt_vals(mm, nm);
458458
if vals.is_empty() { return None::<~str>; }
459459
return match vals[0] { Val(ref s) => Some::<~str>((*s).clone()),
460-
_ => Some::<~str>(def.to_owned()) }
460+
_ => Some::<~str>(str::to_owned(def)) }
461461
}
462462

463463
#[deriving(Eq)]
@@ -497,10 +497,10 @@ pub mod groups {
497497
desc: &str, hint: &str) -> OptGroup {
498498
let len = short_name.len();
499499
assert!(len == 1 || len == 0);
500-
return OptGroup { short_name: short_name.to_owned(),
501-
long_name: long_name.to_owned(),
502-
hint: hint.to_owned(),
503-
desc: desc.to_owned(),
500+
return OptGroup { short_name: str::to_owned(short_name),
501+
long_name: str::to_owned(long_name),
502+
hint: str::to_owned(hint),
503+
desc: str::to_owned(desc),
504504
hasarg: Yes,
505505
occur: Req};
506506
}
@@ -510,10 +510,10 @@ pub mod groups {
510510
desc: &str, hint: &str) -> OptGroup {
511511
let len = short_name.len();
512512
assert!(len == 1 || len == 0);
513-
return OptGroup {short_name: short_name.to_owned(),
514-
long_name: long_name.to_owned(),
515-
hint: hint.to_owned(),
516-
desc: desc.to_owned(),
513+
return OptGroup {short_name: str::to_owned(short_name),
514+
long_name: str::to_owned(long_name),
515+
hint: str::to_owned(hint),
516+
desc: str::to_owned(desc),
517517
hasarg: Yes,
518518
occur: Optional};
519519
}
@@ -523,10 +523,10 @@ pub mod groups {
523523
desc: &str) -> OptGroup {
524524
let len = short_name.len();
525525
assert!(len == 1 || len == 0);
526-
return OptGroup {short_name: short_name.to_owned(),
527-
long_name: long_name.to_owned(),
526+
return OptGroup {short_name: str::to_owned(short_name),
527+
long_name: str::to_owned(long_name),
528528
hint: ~"",
529-
desc: desc.to_owned(),
529+
desc: str::to_owned(desc),
530530
hasarg: No,
531531
occur: Optional};
532532
}
@@ -536,10 +536,10 @@ pub mod groups {
536536
desc: &str, hint: &str) -> OptGroup {
537537
let len = short_name.len();
538538
assert!(len == 1 || len == 0);
539-
return OptGroup {short_name: short_name.to_owned(),
540-
long_name: long_name.to_owned(),
541-
hint: hint.to_owned(),
542-
desc: desc.to_owned(),
539+
return OptGroup {short_name: str::to_owned(short_name),
540+
long_name: str::to_owned(long_name),
541+
hint: str::to_owned(hint),
542+
desc: str::to_owned(desc),
543543
hasarg: Maybe,
544544
occur: Optional};
545545
}
@@ -552,10 +552,10 @@ pub mod groups {
552552
desc: &str, hint: &str) -> OptGroup {
553553
let len = short_name.len();
554554
assert!(len == 1 || len == 0);
555-
return OptGroup {short_name: short_name.to_owned(),
556-
long_name: long_name.to_owned(),
557-
hint: hint.to_owned(),
558-
desc: desc.to_owned(),
555+
return OptGroup {short_name: str::to_owned(short_name),
556+
long_name: str::to_owned(long_name),
557+
hint: str::to_owned(hint),
558+
desc: str::to_owned(desc),
559559
hasarg: Yes,
560560
occur: Multi};
561561
}
@@ -678,7 +678,7 @@ pub mod groups {
678678
row
679679
});
680680

681-
return brief.to_owned() +
681+
return str::to_owned(brief) +
682682
"\n\nOptions:\n" +
683683
rows.collect::<~[~str]>().connect("\n") +
684684
"\n\n";

branches/try2/src/libextra/json.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub enum Json {
4141
}
4242

4343
pub type List = ~[Json];
44-
pub type Object = TreeMap<~str, Json>;
44+
pub type Object = HashMap<~str, Json>;
4545

4646
#[deriving(Eq)]
4747
/// If an error occurs while parsing some JSON, this is the structure which is
@@ -809,7 +809,7 @@ impl<T : iterator::Iterator<char>> Parser<T> {
809809
self.bump();
810810
self.parse_whitespace();
811811

812-
let mut values = ~TreeMap::new();
812+
let mut values = ~HashMap::new();
813813

814814
if self.ch == '}' {
815815
self.bump();
@@ -1087,7 +1087,7 @@ impl serialize::Decoder for Decoder {
10871087
let len = match self.stack.pop() {
10881088
Object(obj) => {
10891089
let len = obj.len();
1090-
for obj.consume_iter().advance |(key, value)| {
1090+
for obj.consume().advance |(key, value)| {
10911091
self.stack.push(value);
10921092
self.stack.push(String(key));
10931093
}
@@ -1294,19 +1294,19 @@ impl<A:ToJson> ToJson for ~[A] {
12941294
fn to_json(&self) -> Json { List(self.map(|elt| elt.to_json())) }
12951295
}
12961296

1297-
impl<A:ToJson> ToJson for TreeMap<~str, A> {
1297+
impl<A:ToJson> ToJson for HashMap<~str, A> {
12981298
fn to_json(&self) -> Json {
1299-
let mut d = TreeMap::new();
1299+
let mut d = HashMap::new();
13001300
for self.iter().advance |(key, value)| {
13011301
d.insert((*key).clone(), value.to_json());
13021302
}
13031303
Object(~d)
13041304
}
13051305
}
13061306

1307-
impl<A:ToJson> ToJson for HashMap<~str, A> {
1307+
impl<A:ToJson> ToJson for TreeMap<~str, A> {
13081308
fn to_json(&self) -> Json {
1309-
let mut d = TreeMap::new();
1309+
let mut d = HashMap::new();
13101310
for self.iter().advance |(key, value)| {
13111311
d.insert((*key).clone(), value.to_json());
13121312
}
@@ -1338,11 +1338,11 @@ mod tests {
13381338

13391339
use super::*;
13401340

1341+
use std::hashmap::HashMap;
13411342
use std::io;
13421343
use std::result;
13431344

1344-
use serialize::Decodable;
1345-
use treemap::TreeMap;
1345+
use extra::serialize::Decodable;
13461346

13471347
#[deriving(Eq, Encodable, Decodable)]
13481348
enum Animal {
@@ -1363,7 +1363,7 @@ mod tests {
13631363
}
13641364

13651365
fn mk_object(items: &[(~str, Json)]) -> Json {
1366-
let mut d = ~TreeMap::new();
1366+
let mut d = ~HashMap::new();
13671367

13681368
for items.iter().advance |item| {
13691369
match *item {
@@ -1954,7 +1954,7 @@ mod tests {
19541954
fn test_decode_map() {
19551955
let s = ~"{\"a\": \"Dog\", \"b\": [\"Frog\", \"Henry\", 349]}";
19561956
let mut decoder = Decoder(from_str(s).unwrap());
1957-
let mut map: TreeMap<~str, Animal> = Decodable::decode(&mut decoder);
1957+
let mut map: HashMap<~str, Animal> = Decodable::decode(&mut decoder);
19581958
19591959
assert_eq!(map.pop(&~"a"), Some(Dog));
19601960
assert_eq!(map.pop(&~"b"), Some(Frog(~"Henry", 349)));

0 commit comments

Comments
 (0)