Skip to content

Commit 32fb32e

Browse files
Ariel Ben-Yehudaarielb1
authored andcommitted
---
yaml --- r: 232955 b: refs/heads/try c: ab86bf5 h: refs/heads/master i: 232953: 5068f64 232951: e5b3751 v: v3
1 parent 50f151c commit 32fb32e

File tree

209 files changed

+5227
-14817
lines changed

Some content is hidden

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

209 files changed

+5227
-14817
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 1b908be9a0d7aaf8f18854db1ffef7b8df10dfeb
4+
refs/heads/try: ab86bf53eb2fb9289c7ce811d1615eff2c529e34
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/mk/crates.mk

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TARGET_CRATES := libc std flate arena term \
5656
alloc_system
5757
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
59-
rustc_data_structures rustc_front rustc_platform_intrinsics
59+
rustc_data_structures rustc_platform_intrinsics
6060
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
6161
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
6262

@@ -71,24 +71,23 @@ DEPS_graphviz := std
7171
DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags
7272
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
7373
rustc_typeck rustc_resolve log syntax serialize rustc_llvm \
74-
rustc_trans rustc_privacy rustc_lint rustc_front
74+
rustc_trans rustc_privacy rustc_lint
7575

7676
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
77-
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
78-
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics
79-
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
80-
DEPS_rustc_resolve := rustc rustc_front log syntax
81-
DEPS_rustc_privacy := rustc rustc_front log syntax
77+
log syntax serialize rustc_llvm rustc_platform_intrinsics
78+
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics
79+
DEPS_rustc_borrowck := rustc log graphviz syntax
80+
DEPS_rustc_resolve := rustc log syntax
81+
DEPS_rustc_privacy := rustc log syntax
8282
DEPS_rustc_lint := rustc log syntax
8383
DEPS_rustc := syntax flate arena serialize getopts rbml \
8484
log graphviz rustc_llvm rustc_back rustc_data_structures
8585
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
8686
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
87-
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
88-
DEPS_rustc_front := std syntax log serialize
87+
DEPS_rustc_back := std syntax rustc_llvm flate log libc
8988
DEPS_rustc_data_structures := std log serialize
9089
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
91-
test rustc_lint rustc_front
90+
test rustc_lint
9291
DEPS_rustc_bitflags := core
9392
DEPS_flate := std native:miniz
9493
DEPS_arena := std

branches/try/mk/docs.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ ifdef CFG_DISABLE_DOCS
191191
endif
192192

193193
docs: $(DOC_TARGETS)
194-
doc: docs
195194
compiler-docs: $(COMPILER_DOC_TARGETS)
196195

197196
trpl: doc/book/index.html

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
268268
// FIXME (#9639): This needs to handle non-utf8 paths
269269
let mut args = vec!("-".to_owned(),
270270
"-Zunstable-options".to_owned(),
271-
"--unpretty".to_owned(),
271+
"--pretty".to_owned(),
272272
pretty_type,
273273
format!("--target={}", config.target),
274274
"-L".to_owned(),

branches/try/src/doc/trpl/rust-inside-other-languages.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,6 @@ And finally, we can try running it:
217217

218218
```bash
219219
$ ruby embed.rb
220-
Thread finished with count=5000000
221-
Thread finished with count=5000000
222-
Thread finished with count=5000000
223-
Thread finished with count=5000000
224-
Thread finished with count=5000000
225-
Thread finished with count=5000000
226-
Thread finished with count=5000000
227-
Thread finished with count=5000000
228-
Thread finished with count=5000000
229-
Thread finished with count=5000000
230-
done!
231220
done!
232221
$
233222
```

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Structs
22

3-
`struct`s are a way of creating more complex data types. For example, if we were
3+
Structs are a way of creating more complex data types. For example, if we were
44
doing calculations involving coordinates in 2D space, we would need both an `x`
55
and a `y` value:
66

@@ -9,7 +9,7 @@ let origin_x = 0;
99
let origin_y = 0;
1010
```
1111

12-
A `struct` lets us combine these two into a single, unified datatype:
12+
A struct lets us combine these two into a single, unified datatype:
1313

1414
```rust
1515
struct Point {
@@ -28,14 +28,14 @@ There’s a lot going on here, so let’s break it down. We declare a `struct` w
2828
the `struct` keyword, and then with a name. By convention, `struct`s begin with
2929
a capital letter and are camel cased: `PointInSpace`, not `Point_In_Space`.
3030

31-
We can create an instance of our `struct` via `let`, as usual, but we use a `key:
31+
We can create an instance of our struct via `let`, as usual, but we use a `key:
3232
value` style syntax to set each field. The order doesn’t need to be the same as
3333
in the original declaration.
3434

3535
Finally, because fields have names, we can access the field through dot
3636
notation: `origin.x`.
3737

38-
The values in `struct`s are immutable by default, like other bindings in Rust.
38+
The values in structs are immutable by default, like other bindings in Rust.
3939
Use `mut` to make them mutable:
4040

4141
```rust
@@ -91,7 +91,7 @@ fn main() {
9191
# Update syntax
9292

9393
A `struct` can include `..` to indicate that you want to use a copy of some
94-
other `struct` for some of the values. For example:
94+
other struct for some of the values. For example:
9595

9696
```rust
9797
struct Point3d {
@@ -121,7 +121,7 @@ let point = Point3d { z: 1, x: 2, .. origin };
121121
# Tuple structs
122122

123123
Rust has another data type that’s like a hybrid between a [tuple][tuple] and a
124-
`struct`, called a ‘tuple struct’. Tuple structs have a name, but
124+
struct, called a ‘tuple struct’. Tuple structs have a name, but
125125
their fields don’t:
126126

127127
```rust
@@ -140,7 +140,7 @@ let black = Color(0, 0, 0);
140140
let origin = Point(0, 0, 0);
141141
```
142142

143-
It is almost always better to use a `struct` than a tuple struct. We would write
143+
It is almost always better to use a struct than a tuple struct. We would write
144144
`Color` and `Point` like this instead:
145145

146146
```rust
@@ -158,7 +158,7 @@ struct Point {
158158
```
159159

160160
Now, we have actual names, rather than positions. Good names are important,
161-
and with a `struct`, we have actual names.
161+
and with a struct, we have actual names.
162162

163163
There _is_ one case when a tuple struct is very useful, though, and that’s a
164164
tuple struct with only one element. We call this the ‘newtype’ pattern, because
@@ -180,13 +180,13 @@ destructuring `let`, just as with regular tuples. In this case, the
180180

181181
# Unit-like structs
182182

183-
You can define a `struct` with no members at all:
183+
You can define a struct with no members at all:
184184

185185
```rust
186186
struct Electron;
187187
```
188188

189-
Such a `struct` is called ‘unit-like’ because it resembles the empty
189+
Such a struct is called ‘unit-like’ because it resembles the empty
190190
tuple, `()`, sometimes called ‘unit’. Like a tuple struct, it defines a
191191
new type.
192192

@@ -195,6 +195,6 @@ marker type), but in combination with other features, it can become
195195
useful. For instance, a library may ask you to create a structure that
196196
implements a certain [trait][trait] to handle events. If you don’t have
197197
any data you need to store in the structure, you can just create a
198-
unit-like `struct`.
198+
unit-like struct.
199199

200200
[trait]: traits.html

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ fn normal<T: ConvertTo<i64>>(x: &T) -> i64 {
390390

391391
// can be called with T == i64
392392
fn inverse<T>() -> T
393-
// this is using ConvertTo as if it were "ConvertTo<i64>"
393+
// this is using ConvertTo as if it were "ConvertFrom<i32>"
394394
where i32: ConvertTo<T> {
395395
42.convert()
396396
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl<K, V> Drop for Node<K, V> {
296296
self.destroy();
297297
}
298298

299-
self.keys = unsafe { Unique::new(ptr::null_mut()) };
299+
self.keys = unsafe { Unique::new(0 as *mut K) };
300300
}
301301
}
302302

branches/try/src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ impl<T> ops::Deref for Vec<T> {
11351135
fn deref(&self) -> &[T] {
11361136
unsafe {
11371137
let p = self.buf.ptr();
1138-
assume(!p.is_null());
1138+
assume(p != 0 as *mut T);
11391139
slice::from_raw_parts(p, self.len)
11401140
}
11411141
}

branches/try/src/libcore/cell.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl<T:Copy> Cell<T> {
231231
/// ```
232232
#[inline]
233233
#[unstable(feature = "as_unsafe_cell", issue = "27708")]
234-
pub unsafe fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
234+
pub unsafe fn as_unsafe_cell<'a>(&'a self) -> &'a UnsafeCell<T> {
235235
&self.value
236236
}
237237
}
@@ -387,7 +387,7 @@ impl<T: ?Sized> RefCell<T> {
387387
/// ```
388388
#[stable(feature = "rust1", since = "1.0.0")]
389389
#[inline]
390-
pub fn borrow(&self) -> Ref<T> {
390+
pub fn borrow<'a>(&'a self) -> Ref<'a, T> {
391391
match BorrowRef::new(&self.borrow) {
392392
Some(b) => Ref {
393393
_value: unsafe { &*self.value.get() },
@@ -433,7 +433,7 @@ impl<T: ?Sized> RefCell<T> {
433433
/// ```
434434
#[stable(feature = "rust1", since = "1.0.0")]
435435
#[inline]
436-
pub fn borrow_mut(&self) -> RefMut<T> {
436+
pub fn borrow_mut<'a>(&'a self) -> RefMut<'a, T> {
437437
match BorrowRefMut::new(&self.borrow) {
438438
Some(b) => RefMut {
439439
_value: unsafe { &mut *self.value.get() },
@@ -450,7 +450,7 @@ impl<T: ?Sized> RefCell<T> {
450450
/// This function is `unsafe` because `UnsafeCell`'s field is public.
451451
#[inline]
452452
#[unstable(feature = "as_unsafe_cell", issue = "27708")]
453-
pub unsafe fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
453+
pub unsafe fn as_unsafe_cell<'a>(&'a self) -> &'a UnsafeCell<T> {
454454
&self.value
455455
}
456456
}
@@ -541,7 +541,7 @@ impl<'b, T: ?Sized> Deref for Ref<'b, T> {
541541
type Target = T;
542542

543543
#[inline]
544-
fn deref(&self) -> &T {
544+
fn deref<'a>(&'a self) -> &'a T {
545545
self._value
546546
}
547547
}
@@ -750,15 +750,15 @@ impl<'b, T: ?Sized> Deref for RefMut<'b, T> {
750750
type Target = T;
751751

752752
#[inline]
753-
fn deref(&self) -> &T {
753+
fn deref<'a>(&'a self) -> &'a T {
754754
self._value
755755
}
756756
}
757757

758758
#[stable(feature = "rust1", since = "1.0.0")]
759759
impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
760760
#[inline]
761-
fn deref_mut(&mut self) -> &mut T {
761+
fn deref_mut<'a>(&'a mut self) -> &'a mut T {
762762
self._value
763763
}
764764
}

branches/try/src/libcore/iter.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,7 @@ impl<A, B> Iterator for Chain<A, B> where
15131513
fn next(&mut self) -> Option<A::Item> {
15141514
match self.state {
15151515
ChainState::Both => match self.a.next() {
1516-
elt @ Some(..) => elt,
1516+
elt @ Some(..) => return elt,
15171517
None => {
15181518
self.state = ChainState::Back;
15191519
self.b.next()
@@ -1590,7 +1590,7 @@ impl<A, B> DoubleEndedIterator for Chain<A, B> where
15901590
fn next_back(&mut self) -> Option<A::Item> {
15911591
match self.state {
15921592
ChainState::Both => match self.b.next_back() {
1593-
elt @ Some(..) => elt,
1593+
elt @ Some(..) => return elt,
15941594
None => {
15951595
self.state = ChainState::Front;
15961596
self.a.next_back()
@@ -1683,7 +1683,7 @@ impl<B, I: Iterator, F> Iterator for Map<I, F> where F: FnMut(I::Item) -> B {
16831683

16841684
#[inline]
16851685
fn next(&mut self) -> Option<B> {
1686-
self.iter.next().map(&mut self.f)
1686+
self.iter.next().map(|a| (self.f)(a))
16871687
}
16881688

16891689
#[inline]
@@ -1698,7 +1698,7 @@ impl<B, I: DoubleEndedIterator, F> DoubleEndedIterator for Map<I, F> where
16981698
{
16991699
#[inline]
17001700
fn next_back(&mut self) -> Option<B> {
1701-
self.iter.next_back().map(&mut self.f)
1701+
self.iter.next_back().map(|a| (self.f)(a))
17021702
}
17031703
}
17041704

@@ -2210,7 +2210,7 @@ impl<I: Iterator, U: IntoIterator, F> Iterator for FlatMap<I, U, F>
22102210
return Some(x)
22112211
}
22122212
}
2213-
match self.iter.next().map(&mut self.f) {
2213+
match self.iter.next().map(|x| (self.f)(x)) {
22142214
None => return self.backiter.as_mut().and_then(|it| it.next()),
22152215
next => self.frontiter = next.map(IntoIterator::into_iter),
22162216
}
@@ -2243,7 +2243,7 @@ impl<I: DoubleEndedIterator, U, F> DoubleEndedIterator for FlatMap<I, U, F> wher
22432243
return Some(y)
22442244
}
22452245
}
2246-
match self.iter.next_back().map(&mut self.f) {
2246+
match self.iter.next_back().map(|x| (self.f)(x)) {
22472247
None => return self.frontiter.as_mut().and_then(|it| it.next_back()),
22482248
next => self.backiter = next.map(IntoIterator::into_iter),
22492249
}

branches/try/src/libcore/nonzero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<T: Zeroable> Deref for NonZero<T> {
5151
type Target = T;
5252

5353
#[inline]
54-
fn deref(&self) -> &T {
54+
fn deref<'a>(&'a self) -> &'a T {
5555
let NonZero(ref inner) = *self;
5656
inner
5757
}

branches/try/src/libcore/num/flt2dec/bignum.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ macro_rules! define_bignum {
211211
self
212212
}
213213

214-
pub fn add_small(&mut self, other: $ty) -> &mut $name {
214+
pub fn add_small<'a>(&'a mut self, other: $ty) -> &'a mut $name {
215215
use num::flt2dec::bignum::FullOps;
216216

217217
let (mut carry, v) = self.base[0].full_add(other, false);
@@ -248,7 +248,7 @@ macro_rules! define_bignum {
248248

249249
/// Multiplies itself by a digit-sized `other` and returns its own
250250
/// mutable reference.
251-
pub fn mul_small(&mut self, other: $ty) -> &mut $name {
251+
pub fn mul_small<'a>(&'a mut self, other: $ty) -> &'a mut $name {
252252
use num::flt2dec::bignum::FullOps;
253253

254254
let mut sz = self.size;
@@ -267,7 +267,7 @@ macro_rules! define_bignum {
267267
}
268268

269269
/// Multiplies itself by `2^bits` and returns its own mutable reference.
270-
pub fn mul_pow2(&mut self, bits: usize) -> &mut $name {
270+
pub fn mul_pow2<'a>(&'a mut self, bits: usize) -> &'a mut $name {
271271
use mem;
272272

273273
let digitbits = mem::size_of::<$ty>() * 8;
@@ -308,7 +308,7 @@ macro_rules! define_bignum {
308308
}
309309

310310
/// Multiplies itself by `5^e` and returns its own mutable reference.
311-
pub fn mul_pow5(&mut self, mut e: usize) -> &mut $name {
311+
pub fn mul_pow5<'a>(&'a mut self, mut e: usize) -> &'a mut $name {
312312
use mem;
313313
use num::flt2dec::bignum::SMALL_POW5;
314314

@@ -377,7 +377,7 @@ macro_rules! define_bignum {
377377

378378
/// Divides itself by a digit-sized `other` and returns its own
379379
/// mutable reference *and* the remainder.
380-
pub fn div_rem_small(&mut self, other: $ty) -> (&mut $name, $ty) {
380+
pub fn div_rem_small<'a>(&'a mut self, other: $ty) -> (&'a mut $name, $ty) {
381381
use num::flt2dec::bignum::FullOps;
382382

383383
assert!(other > 0);

branches/try/src/libcore/num/flt2dec/strategy/dragon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static POW10TO256: [Digit; 27] =
4242
0xcc5573c0, 0x65f9ef17, 0x55bc28f2, 0x80dcc7f7, 0xf46eeddc, 0x5fdcefce, 0x553f7];
4343

4444
#[doc(hidden)]
45-
pub fn mul_pow10(x: &mut Big, n: usize) -> &mut Big {
45+
pub fn mul_pow10<'a>(x: &'a mut Big, n: usize) -> &'a mut Big {
4646
debug_assert!(n < 512);
4747
if n & 7 != 0 { x.mul_small(POW10[n & 7]); }
4848
if n & 8 != 0 { x.mul_small(POW10[8]); }
@@ -54,7 +54,7 @@ pub fn mul_pow10(x: &mut Big, n: usize) -> &mut Big {
5454
x
5555
}
5656

57-
fn div_2pow10(x: &mut Big, mut n: usize) -> &mut Big {
57+
fn div_2pow10<'a>(x: &'a mut Big, mut n: usize) -> &'a mut Big {
5858
let largest = POW10.len() - 1;
5959
while n > largest {
6060
x.div_rem_small(POW10[largest]);

0 commit comments

Comments
 (0)