Skip to content

Commit 6adc9f9

Browse files
committed
---
yaml --- r: 188114 b: refs/heads/try c: d79e910 h: refs/heads/master v: v3
1 parent 563414b commit 6adc9f9

File tree

168 files changed

+3151
-5199
lines changed

Some content is hidden

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

168 files changed

+3151
-5199
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 38e97b99a6b133cb4c621c68e75b28abc6c617c1
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: 3cfe2f4e4f6207f53d4e2e7201b7b2aeff802d84
5+
refs/heads/try: d79e91033770fc5a760d34511769f5ba6c872c77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ then
875875
| cut -d ' ' -f 2)
876876

877877
case $CFG_CLANG_VERSION in
878-
(3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
878+
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
879879
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
880880
if [ -z "$CC" ]
881881
then

branches/try/mk/crates.mk

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ TARGET_CRATES := libc std flate arena term \
5454
log graphviz core rbml alloc \
5555
unicode rustc_bitflags
5656
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
57-
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint
57+
rustc_trans rustc_back rustc_llvm rustc_privacy
5858
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
5959
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
6060
TOOLS := compiletest rustdoc rustc rustbook
@@ -70,21 +70,20 @@ DEPS_graphviz := std
7070
DEPS_syntax := std term serialize log fmt_macros arena libc
7171
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
7272
rustc_typeck rustc_resolve log syntax serialize rustc_llvm \
73-
rustc_trans rustc_privacy rustc_lint
73+
rustc_trans rustc_privacy
7474

7575
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7676
log syntax serialize rustc_llvm
7777
DEPS_rustc_typeck := rustc syntax
7878
DEPS_rustc_borrowck := rustc log graphviz syntax
7979
DEPS_rustc_resolve := rustc log syntax
8080
DEPS_rustc_privacy := rustc log syntax
81-
DEPS_rustc_lint := rustc log syntax
8281
DEPS_rustc := syntax flate arena serialize getopts rbml \
8382
log graphviz rustc_llvm rustc_back
8483
DEPS_rustc_llvm := native:rustllvm libc std
8584
DEPS_rustc_back := std syntax rustc_llvm flate log libc
8685
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
87-
test rustc_lint
86+
test
8887
DEPS_rustc_bitflags := core
8988
DEPS_flate := std native:miniz
9089
DEPS_arena := std
@@ -129,13 +128,11 @@ DOC_CRATES := $(filter-out rustc, \
129128
$(filter-out rustc_resolve, \
130129
$(filter-out rustc_driver, \
131130
$(filter-out rustc_privacy, \
132-
$(filter-out rustc_lint, \
133131
$(filter-out log, \
134132
$(filter-out getopts, \
135-
$(filter-out syntax, $(CRATES))))))))))))
133+
$(filter-out syntax, $(CRATES)))))))))))
136134
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
137-
rustc_typeck rustc_driver syntax rustc_privacy \
138-
rustc_lint
135+
rustc_typeck rustc_driver syntax rustc_privacy
139136

140137
# This macro creates some simple definitions for each crate being built, just
141138
# some munging of all of the parameters above.

branches/try/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $(eval $(call RUST_CRATE,coretest))
2121

2222
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
2323
TEST_DOC_CRATES = $(DOC_CRATES)
24-
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve rustc_trans rustc_lint,\
24+
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve rustc_trans,\
2525
$(HOST_CRATES))
2626
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2727

branches/try/src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#![feature(std_misc)]
2121
#![feature(test)]
2222
#![feature(unicode)]
23+
#![feature(env)]
2324
#![feature(core)]
2425

2526
#![deny(warnings)]

branches/try/src/doc/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ use std::thread::Thread;
536536
537537
fn main() {
538538
let numbers = vec![1, 2, 3];
539-
539+
540540
let guards: Vec<_> = (0..3).map(|i| {
541541
Thread::scoped(move || {
542542
println!("{}", numbers[i]);
@@ -565,7 +565,7 @@ while retaining safety. The answer is iterators:
565565
```{rust}
566566
let vec = vec![1, 2, 3];
567567
568-
for x in &vec {
568+
for x in vec.iter() {
569569
println!("{}", x);
570570
}
571571
```

branches/try/src/doc/reference.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ nonzero_dec: '1' | '2' | '3' | '4'
302302

303303
A _character literal_ is a single Unicode character enclosed within two
304304
`U+0027` (single-quote) characters, with the exception of `U+0027` itself,
305-
which must be _escaped_ by a preceding `U+005C` character (`\`).
305+
which must be _escaped_ by a preceding U+005C character (`\`).
306306

307307
##### String literals
308308

@@ -311,19 +311,6 @@ A _string literal_ is a sequence of any Unicode characters enclosed within two
311311
which must be _escaped_ by a preceding `U+005C` character (`\`), or a _raw
312312
string literal_.
313313

314-
A multi-line string literal may be defined by terminating each line with a
315-
`U+005C` character (`\`) immediately before the newline. This causes the
316-
`U+005C` character, the newline, and all whitespace at the beginning of the
317-
next line to be ignored.
318-
319-
```rust
320-
let a = "foobar";
321-
let b = "foo\
322-
bar";
323-
324-
assert_eq!(a,b);
325-
```
326-
327314
##### Character escapes
328315

329316
Some additional _escapes_ are available in either character or non-raw string
@@ -3765,9 +3752,9 @@ An example of creating and calling a closure:
37653752
```rust
37663753
let captured_var = 10;
37673754

3768-
let closure_no_args = || println!("captured_var={}", captured_var);
3755+
let closure_no_args = |&:| println!("captured_var={}", captured_var);
37693756

3770-
let closure_args = |arg: i32| -> i32 {
3757+
let closure_args = |&: arg: i32| -> i32 {
37713758
println!("captured_var={}, arg={}", captured_var, arg);
37723759
arg // Note lack of semicolon after 'arg'
37733760
};

branches/try/src/doc/trpl/hello-cargo.md

Lines changed: 4 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ the Cargo
1818
README](https://github.com/rust-lang/cargo#installing-cargo-from-nightlies)
1919
for specific instructions about installing it.
2020

21-
## Converting to Cargo
22-
2321
Let's convert Hello World to Cargo.
2422

2523
To Cargo-ify our project, we need to do two things: Make a `Cargo.toml`
2624
configuration file, and put our source file in the right place. Let's
2725
do that part first:
2826

29-
```bash
27+
```{bash}
3028
$ mkdir src
3129
$ mv main.rs src/main.rs
3230
```
@@ -38,7 +36,7 @@ place for everything, and everything in its place.
3836

3937
Next, our configuration file:
4038

41-
```bash
39+
```{bash}
4240
$ editor Cargo.toml
4341
```
4442

@@ -75,7 +73,7 @@ well as what it is named.
7573

7674
Once you have this file in place, we should be ready to build! Try this:
7775

78-
```bash
76+
```{bash}
7977
$ cargo build
8078
Compiling hello_world v0.0.1 (file:///home/yourname/projects/hello_world)
8179
$ ./target/hello_world
@@ -105,62 +103,6 @@ That's it! We've successfully built `hello_world` with Cargo. Even though our
105103
program is simple, it's using much of the real tooling that you'll use for the
106104
rest of your Rust career.
107105

108-
## A New Project
109-
110-
You don't have to go through this whole process every time you want to start a new
111-
project! Cargo has the ability to make a bare-bones project directory in which you
112-
can start developing right away.
113-
114-
To start a new project with Cargo, use `cargo new`:
115-
116-
```bash
117-
$ cargo new hello_world --bin
118-
```
119-
120-
We're passing `--bin` because we're making a binary program: if we
121-
were making a library, we'd leave it off.
122-
123-
Let's check out what Cargo has generated for us:
124-
125-
```bash
126-
$ cd hello_world
127-
$ tree .
128-
.
129-
├── Cargo.toml
130-
└── src
131-
└── main.rs
132-
133-
1 directory, 2 files
134-
```
135-
136-
If you don't have the `tree` command, you can probably get it from your distro's package
137-
manager. It's not necessary, but it's certainly useful.
138-
139-
This is all we need to get started. First, let's check out `Cargo.toml`:
140-
141-
```toml
142-
[package]
143-
144-
name = "hello_world"
145-
version = "0.0.1"
146-
authors = ["Your Name <[email protected]>"]
147-
```
148-
149-
Cargo has populated this file with reasonable defaults based off the arguments you gave
150-
it and your `git` global configuration. You may notice that Cargo has also initialized
151-
the `hello_world` directory as a `git` repository.
152-
153-
Here's what's in `src/main.rs`:
154-
155-
```rust
156-
fn main() {
157-
println!("Hello, world!");
158-
}
159-
```
160-
161-
Cargo has generated a "Hello World!" for us, and you're ready to start coding! A
162-
much more in-depth guide to Cargo can be found [here](http://doc.crates.io/guide.html).
163-
164106
Now that you've got the tools down, let's actually learn more about the Rust
165107
language itself. These are the basics that will serve you well through the rest
166-
of your time with Rust.
108+
of your time with Rust.

branches/try/src/doc/trpl/installing-rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ If you've got Rust installed, you can open up a shell, and type this:
7070
$ rustc --version
7171
```
7272

73-
You should see the version number, commit hash, commit date and build date:
73+
You should see some output that looks something like this:
7474

7575
```bash
76-
rustc 1.0.0-nightly (f11f3e7ba 2015-01-04) (built 2015-01-06)
76+
rustc 1.0.0-nightly (f11f3e7ba 2015-01-04 20:02:14 +0000)
7777
```
7878

7979
If you did, Rust has been installed successfully! Congrats!

branches/try/src/doc/trpl/plugins.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ extern crate rustc;
7171
use syntax::codemap::Span;
7272
use syntax::parse::token;
7373
use syntax::ast::{TokenTree, TtToken};
74-
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
75-
use syntax::ext::build::AstBuilder; // trait for expr_usize
74+
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacExpr};
75+
use syntax::ext::build::AstBuilder; // trait for expr_uint
7676
use rustc::plugin::Registry;
7777
7878
fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
@@ -107,7 +107,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
107107
}
108108
}
109109
110-
MacEager::expr(cx.expr_usize(sp, total))
110+
MacExpr::new(cx.expr_uint(sp, total))
111111
}
112112
113113
#[plugin_registrar]
@@ -183,7 +183,7 @@ with
183183
[`syntax::print::pprust::*_to_string`](http://doc.rust-lang.org/syntax/print/pprust/index.html#functions).
184184

185185
The example above produced an integer literal using
186-
[`AstBuilder::expr_usize`](../syntax/ext/build/trait.AstBuilder.html#tymethod.expr_usize).
186+
[`AstBuilder::expr_uint`](../syntax/ext/build/trait.AstBuilder.html#tymethod.expr_uint).
187187
As an alternative to the `AstBuilder` trait, `libsyntax` provides a set of
188188
[quasiquote macros](../syntax/ext/quote/index.html). They are undocumented and
189189
very rough around the edges. However, the implementation may be a good

branches/try/src/liballoc/heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ mod imp {
300300
libc::realloc(ptr as *mut libc::c_void, size as libc::size_t) as *mut u8
301301
} else {
302302
let new_ptr = allocate(size, align);
303-
ptr::copy(new_ptr, ptr, cmp::min(size, old_size));
303+
ptr::copy_memory(new_ptr, ptr, cmp::min(size, old_size));
304304
deallocate(ptr, old_size, align);
305305
new_ptr
306306
}

branches/try/src/libcollections/bit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,19 +818,19 @@ impl BitVec {
818818
let full_value = if value { !0 } else { 0 };
819819

820820
// Correct the old tail word, setting or clearing formerly unused bits
821-
let num_cur_blocks = blocks_for_bits(self.nbits);
821+
let old_last_word = blocks_for_bits(self.nbits) - 1;
822822
if self.nbits % u32::BITS > 0 {
823823
let mask = mask_for_bits(self.nbits);
824824
if value {
825-
self.storage[num_cur_blocks - 1] |= !mask;
825+
self.storage[old_last_word] |= !mask;
826826
} else {
827827
// Extra bits are already zero by invariant.
828828
}
829829
}
830830

831831
// Fill in words after the old tail word
832832
let stop_idx = cmp::min(self.storage.len(), new_nblocks);
833-
for idx in num_cur_blocks..stop_idx {
833+
for idx in old_last_word + 1..stop_idx {
834834
self.storage[idx] = full_value;
835835
}
836836

branches/try/src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use core::fmt::Debug;
2525
use core::hash::{Hash, Hasher};
2626
use core::iter::{Map, FromIterator, IntoIterator};
2727
use core::ops::{Index, IndexMut};
28-
use core::{iter, fmt, mem, usize};
28+
use core::{iter, fmt, mem};
2929
use Bound::{self, Included, Excluded, Unbounded};
3030

3131
use borrow::Borrow;
@@ -1467,7 +1467,7 @@ macro_rules! range_impl {
14671467
$Range {
14681468
inner: AbsIter {
14691469
traversals: traversals,
1470-
size: usize::MAX, // unused
1470+
size: 0, // unused
14711471
}
14721472
}
14731473
}

branches/try/src/libcollections/btree/node.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,8 +1215,7 @@ impl<K, V> Node<K, V> {
12151215
ptr::copy(
12161216
self.edges_mut().as_mut_ptr().offset(index as isize),
12171217
self.edges().as_ptr().offset(index as isize + 1),
1218-
// index can be == len+1, so do the +1 first to avoid underflow.
1219-
(self.len() + 1) - index
1218+
self.len() - index + 1
12201219
);
12211220

12221221
edge

branches/try/src/libcollections/slice.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ use core::iter::{range_step, MultiplicativeIterator};
9696
use core::marker::Sized;
9797
use core::mem::size_of;
9898
use core::mem;
99-
use core::num::wrapping::WrappingOps;
10099
use core::ops::FnMut;
101100
use core::option::Option::{self, Some, None};
102101
use core::ptr::PtrExt;
@@ -1210,22 +1209,18 @@ struct SizeDirection {
12101209
impl Iterator for ElementSwaps {
12111210
type Item = (usize, usize);
12121211

1213-
// #[inline]
1212+
#[inline]
12141213
fn next(&mut self) -> Option<(usize, usize)> {
1215-
fn new_pos_wrapping(i: usize, s: Direction) -> usize {
1216-
i.wrapping_add(match s { Pos => 1, Neg => -1 })
1217-
}
1218-
12191214
fn new_pos(i: usize, s: Direction) -> usize {
1220-
match s { Pos => i + 1, Neg => i - 1 }
1215+
i + match s { Pos => 1, Neg => -1 }
12211216
}
12221217

12231218
// Find the index of the largest mobile element:
12241219
// The direction should point into the vector, and the
12251220
// swap should be with a smaller `size` element.
12261221
let max = self.sdir.iter().cloned().enumerate()
12271222
.filter(|&(i, sd)|
1228-
new_pos_wrapping(i, sd.dir) < self.sdir.len() &&
1223+
new_pos(i, sd.dir) < self.sdir.len() &&
12291224
self.sdir[new_pos(i, sd.dir)].size < sd.size)
12301225
.max_by(|&(_, sd)| sd.size);
12311226
match max {
@@ -2668,15 +2663,15 @@ mod tests {
26682663
let (left, right) = values.split_at_mut(2);
26692664
{
26702665
let left: &[_] = left;
2671-
assert!(left[..left.len()] == [1, 2]);
2666+
assert!(left[..left.len()] == [1, 2][]);
26722667
}
26732668
for p in left {
26742669
*p += 1;
26752670
}
26762671

26772672
{
26782673
let right: &[_] = right;
2679-
assert!(right[..right.len()] == [3, 4, 5]);
2674+
assert!(right[..right.len()] == [3, 4, 5][]);
26802675
}
26812676
for p in right {
26822677
*p += 2;

0 commit comments

Comments
 (0)