Skip to content

Commit 0a6b3e2

Browse files
committed
---
yaml --- r: 81718 b: refs/heads/master c: 44997a1 h: refs/heads/master v: v3
1 parent 3de611a commit 0a6b3e2

35 files changed

+291
-241
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: 76a53911b45aad4bb036bd7af596b6c43dd600a8
2+
refs/heads/master: 44997a127bb9acc1957d809a0e6cad190b75e491
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ documentation.
6161

6262
[repo]: https://github.com/mozilla/rust
6363
[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz
64-
[tutorial]: http://static.rust-lang.org/doc/tutorial.html
64+
[tutorial]: http://static.rust-lang.org/doc/0.7/tutorial.html
6565

6666
## Notes
6767

trunk/doc/tutorial-container.md

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
The container traits are defined in the `std::container` module.
66

7-
## Unique and managed vectors
7+
## Unique vectors
88

9-
Vectors have `O(1)` indexing and removal from the end, along with `O(1)`
10-
amortized insertion. Vectors are the most common container in Rust, and are
11-
flexible enough to fit many use cases.
9+
Vectors have `O(1)` indexing, push (to the end) and pop (from the end). Vectors
10+
are the most common container in Rust, and are flexible enough to fit many use
11+
cases.
1212

1313
Vectors can also be sorted and used as efficient lookup tables with the
14-
`std::vec::bsearch` function, if all the elements are inserted at one time and
14+
`bsearch()` method, if all the elements are inserted at one time and
1515
deletions are unnecessary.
1616

1717
## Maps and sets
@@ -42,10 +42,15 @@ implementing the `IterBytes` trait.
4242

4343
## Double-ended queues
4444

45-
The `extra::deque` module implements a double-ended queue with `O(1)` amortized
46-
inserts and removals from both ends of the container. It also has `O(1)`
47-
indexing like a vector. The contained elements are not required to be copyable,
48-
and the queue will be sendable if the contained type is sendable.
45+
The `extra::ringbuf` module implements a double-ended queue with `O(1)`
46+
amortized inserts and removals from both ends of the container. It also has
47+
`O(1)` indexing like a vector. The contained elements are not required to be
48+
copyable, and the queue will be sendable if the contained type is sendable.
49+
Its interface `Deque` is defined in `extra::collections`.
50+
51+
The `extra::dlist` module implements a double-ended linked list, also
52+
implementing the `Deque` trait, with `O(1)` removals and inserts at either end,
53+
and `O(1)` concatenation.
4954

5055
## Priority queues
5156

@@ -197,11 +202,11 @@ The function `range` (or `range_inclusive`) allows to simply iterate through a g
197202
198203
~~~
199204
for i in range(0, 5) {
200-
printf!("%d ", i) // prints "0 1 2 3 4"
205+
print!("{} ", i) // prints "0 1 2 3 4"
201206
}
202207

203208
for i in std::iter::range_inclusive(0, 5) { // needs explicit import
204-
printf!("%d ", i) // prints "0 1 2 3 4 5"
209+
print!("{} ", i) // prints "0 1 2 3 4 5"
205210
}
206211
~~~
207212
@@ -233,15 +238,15 @@ let mut it = xs.iter().zip(ys.iter());
233238

234239
// print out the pairs of elements up to (&3, &"baz")
235240
for (x, y) in it {
236-
printfln!("%d %s", *x, *y);
241+
println!("{} {}", *x, *y);
237242

238243
if *x == 3 {
239244
break;
240245
}
241246
}
242247

243248
// yield and print the last pair from the iterator
244-
printfln!("last: %?", it.next());
249+
println!("last: {:?}", it.next());
245250

246251
// the iterator is now fully consumed
247252
assert!(it.next().is_none());
@@ -335,13 +340,13 @@ another `DoubleEndedIterator` with `next` and `next_back` exchanged.
335340
~~~
336341
let xs = [1, 2, 3, 4, 5, 6];
337342
let mut it = xs.iter();
338-
printfln!("%?", it.next()); // prints `Some(&1)`
339-
printfln!("%?", it.next()); // prints `Some(&2)`
340-
printfln!("%?", it.next_back()); // prints `Some(&6)`
343+
println!("{:?}", it.next()); // prints `Some(&1)`
344+
println!("{:?}", it.next()); // prints `Some(&2)`
345+
println!("{:?}", it.next_back()); // prints `Some(&6)`
341346
342347
// prints `5`, `4` and `3`
343348
for &x in it.invert() {
344-
printfln!("%?", x)
349+
println!("{}", x)
345350
}
346351
~~~
347352

@@ -356,11 +361,11 @@ let xs = [1, 2, 3, 4];
356361
let ys = [5, 6, 7, 8];
357362
let mut it = xs.iter().chain(ys.iter()).map(|&x| x * 2);
358363
359-
printfln!("%?", it.next()); // prints `Some(2)`
364+
println!("{:?}", it.next()); // prints `Some(2)`
360365
361366
// prints `16`, `14`, `12`, `10`, `8`, `6`, `4`
362367
for x in it.invert() {
363-
printfln!("%?", x);
368+
println!("{}", x);
364369
}
365370
~~~
366371

@@ -387,17 +392,17 @@ underlying iterators are.
387392
let xs = [1, 2, 3, 4, 5];
388393
let ys = ~[7, 9, 11];
389394
let mut it = xs.iter().chain(ys.iter());
390-
printfln!("%?", it.idx(0)); // prints `Some(&1)`
391-
printfln!("%?", it.idx(5)); // prints `Some(&7)`
392-
printfln!("%?", it.idx(7)); // prints `Some(&11)`
393-
printfln!("%?", it.idx(8)); // prints `None`
395+
println!("{:?}", it.idx(0)); // prints `Some(&1)`
396+
println!("{:?}", it.idx(5)); // prints `Some(&7)`
397+
println!("{:?}", it.idx(7)); // prints `Some(&11)`
398+
println!("{:?}", it.idx(8)); // prints `None`
394399
395400
// yield two elements from the beginning, and one from the end
396401
it.next();
397402
it.next();
398403
it.next_back();
399404
400-
printfln!("%?", it.idx(0)); // prints `Some(&3)`
401-
printfln!("%?", it.idx(4)); // prints `Some(&9)`
402-
printfln!("%?", it.idx(6)); // prints `None`
405+
println!("{:?}", it.idx(0)); // prints `Some(&3)`
406+
println!("{:?}", it.idx(4)); // prints `Some(&9)`
407+
println!("{:?}", it.idx(6)); // prints `None`
403408
~~~

trunk/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,15 +2979,15 @@ tutorials on individual topics.
29792979
* [The foreign function interface][ffi]
29802980
* [Containers and iterators](tutorial-container.html)
29812981
* [Error-handling and Conditions](tutorial-conditions.html)
2982-
* [Packaging up Rust code](rustpkg)
2982+
* [Packaging up Rust code][rustpkg]
29832983

29842984
There is further documentation on the [wiki], however those tend to be even more out of date as this document.
29852985

29862986
[borrow]: tutorial-borrowed-ptr.html
29872987
[tasks]: tutorial-tasks.html
29882988
[macros]: tutorial-macros.html
29892989
[ffi]: tutorial-ffi.html
2990-
[rustpkg]: tutorial-rustpkg.html
2990+
[rustpkg]: rustpkg.html
29912991

29922992
[wiki]: https://github.com/mozilla/rust/wiki/Docs
29932993

trunk/src/libextra/glob.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* `glob`/`fnmatch` functions.
2424
*/
2525

26-
use std::{os, path, util};
26+
use std::{os, path};
2727

2828
use sort;
2929

@@ -356,7 +356,7 @@ impl Pattern {
356356
chars_eq(c, c2, options.case_sensitive)
357357
}
358358
AnySequence => {
359-
util::unreachable()
359+
unreachable!()
360360
}
361361
};
362362
if !matches {

trunk/src/libextra/terminfo/parm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
261261
flags.width = (cur as uint - '0' as uint);
262262
fstate = FormatStateWidth;
263263
}
264-
_ => util::unreachable()
264+
_ => unreachable!()
265265
}
266266
state = FormatPattern(flags, fstate);
267267
}
@@ -487,7 +487,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<~[u8],~str> {
487487
FormatDigit => 10,
488488
FormatOctal => 8,
489489
FormatHex|FormatHEX => 16,
490-
FormatString => util::unreachable()
490+
FormatString => unreachable!()
491491
};
492492
let mut s = ~[];
493493
match op {
@@ -535,7 +535,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<~[u8],~str> {
535535
s.push_all_move(s_);
536536
}
537537
}
538-
FormatString => util::unreachable()
538+
FormatString => unreachable!()
539539
}
540540
s
541541
}

trunk/src/libextra/url.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,12 +1061,16 @@ mod tests {
10611061
10621062
#[test]
10631063
fn test_decode_form_urlencoded() {
1064+
// FIXME #4449: Commented out because this causes an ICE, but only
1065+
// on FreeBSD
1066+
/*
10641067
assert_eq!(decode_form_urlencoded([]).len(), 0);
10651068
10661069
let s = "a=1&foo+bar=abc&foo+bar=12+%3D+34".as_bytes();
10671070
let form = decode_form_urlencoded(s);
10681071
assert_eq!(form.len(), 2);
1069-
assert_eq!(form.get(&~"a"), &~[~"1"]);
1070-
assert_eq!(form.get(&~"foo bar"), &~[~"abc", ~"12 = 34"]);
1072+
assert_eq!(form.get_ref(&~"a"), &~[~"1"]);
1073+
assert_eq!(form.get_ref(&~"foo bar"), &~[~"abc", ~"12 = 34"]);
1074+
*/
10711075
}
10721076
}

trunk/src/librustc/back/rpath.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use metadata::cstore;
1414
use metadata::filesearch;
1515

1616
use std::hashmap::HashSet;
17-
use std::{os, util, vec};
17+
use std::{os, vec};
1818

1919
fn not_win32(os: session::Os) -> bool {
2020
os != session::OsWin32
@@ -116,7 +116,7 @@ pub fn get_rpath_relative_to_output(os: session::Os,
116116
session::OsAndroid | session::OsLinux | session::OsFreebsd
117117
=> "$ORIGIN",
118118
session::OsMacos => "@executable_path",
119-
session::OsWin32 => util::unreachable()
119+
session::OsWin32 => unreachable!()
120120
};
121121

122122
Path(prefix).push_rel(&os::make_absolute(output).get_relative_to(&os::make_absolute(lib)))

trunk/src/librustc/middle/check_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
126126
Some(&DefStatic(did, false)) => {
127127
let const_expr = lookup_const_by_id(cx.tcx, did).unwrap();
128128
match eval_const_expr(cx.tcx, const_expr) {
129-
const_float(f) if f.is_NaN() => true,
129+
const_float(f) if f.is_nan() => true,
130130
_ => false
131131
}
132132
}
@@ -136,7 +136,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
136136
do walk_pat(*pat) |p| {
137137
if pat_matches_nan(p) {
138138
cx.tcx.sess.span_warn(p.span, "unmatchable NaN in pattern, \
139-
use the is_NaN method in a guard instead");
139+
use the is_nan method in a guard instead");
140140
}
141141
true
142142
};

trunk/src/librustc/middle/entry.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use syntax::codemap::Span;
1818
use syntax::parse::token::special_idents;
1919
use syntax::visit;
2020
use syntax::visit::Visitor;
21-
use std::util;
2221

2322
struct EntryContext {
2423
session: Session,
@@ -94,7 +93,7 @@ fn find_item(item: @item, ctxt: &mut EntryContext) {
9493
ctxt.non_main_fns.push((item.id, item.span));
9594
}
9695
}
97-
_ => util::unreachable()
96+
_ => unreachable!()
9897
}
9998
}
10099

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ fn variant_opt(bcx: @mut Block, pat_id: ast::NodeId)
356356
adt::represent_node(bcx, pat_id))
357357
}
358358
}
359-
::std::util::unreachable();
359+
unreachable!();
360360
}
361361
ast::DefFn(*) |
362362
ast::DefStruct(_) => {

trunk/src/librustdoc/prune_private_pass.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ use fold::Fold;
2020
use fold;
2121
use pass::Pass;
2222

23-
use std::util;
24-
2523
pub fn mk_pass() -> Pass {
2624
Pass {
2725
name: ~"prune_private",
@@ -148,7 +146,7 @@ fn is_visible(srv: astsrv::Srv, doc: doc::ItemDoc) -> bool {
148146
}
149147
}
150148
}
151-
_ => util::unreachable()
149+
_ => unreachable!()
152150
}
153151
}
154152
}

trunk/src/librustpkg/api.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use target::*;
1616
use version::Version;
1717
use workcache_support::*;
1818

19+
use std::os;
1920
use extra::arc::{Arc,RWArc};
2021
use extra::workcache;
2122
use extra::workcache::{Database, Logger, FreshnessMap};
@@ -40,11 +41,13 @@ pub fn new_default_context(c: workcache::Context, p: Path) -> BuildContext {
4041
}
4142

4243
fn file_is_fresh(path: &str, in_hash: &str) -> bool {
43-
in_hash == digest_file_with_date(&Path(path))
44+
let path = Path(path);
45+
os::path_exists(&path) && in_hash == digest_file_with_date(&path)
4446
}
4547

4648
fn binary_is_fresh(path: &str, in_hash: &str) -> bool {
47-
in_hash == digest_only_date(&Path(path))
49+
let path = Path(path);
50+
os::path_exists(&path) && in_hash == digest_only_date(&path)
4851
}
4952

5053
pub fn new_workcache_context(p: &Path) -> workcache::Context {

trunk/src/librustpkg/exit_codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
pub static copy_failed_code: int = 65;
11+
pub static COPY_FAILED_CODE: int = 65;

trunk/src/librustpkg/path_util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ fn target_bin_dir(workspace: &Path) -> Path {
118118
/// directory is, and if the file exists, return it.
119119
pub fn built_executable_in_workspace(pkgid: &PkgId, workspace: &Path) -> Option<Path> {
120120
let mut result = target_build_dir(workspace);
121-
// should use a target-specific subdirectory
122121
result = mk_output_path(Main, Build, pkgid, result);
123122
debug!("built_executable_in_workspace: checking whether %s exists",
124123
result.to_str());

trunk/src/librustpkg/rustpkg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use package_source::PkgSrc;
4747
use target::{WhatToBuild, Everything, is_lib, is_main, is_test, is_bench};
4848
// use workcache_support::{discover_outputs, digest_only_date};
4949
use workcache_support::digest_only_date;
50-
use exit_codes::copy_failed_code;
50+
use exit_codes::COPY_FAILED_CODE;
5151

5252
pub mod api;
5353
mod conditions;
@@ -789,10 +789,10 @@ pub fn main_args(args: &[~str]) {
789789
}.run(sub_cmd, rm_args.clone())
790790
};
791791
// FIXME #9262: This is using the same error code for all errors,
792-
// and at least one test case succeeds if rustpkg returns copy_failed_code,
792+
// and at least one test case succeeds if rustpkg returns COPY_FAILED_CODE,
793793
// when actually, it might set the exit code for that even if a different
794794
// unhandled condition got raised.
795-
if result.is_err() { os::set_exit_status(copy_failed_code); }
795+
if result.is_err() { os::set_exit_status(COPY_FAILED_CODE); }
796796

797797
}
798798

0 commit comments

Comments
 (0)