Skip to content

Commit 2c5664c

Browse files
committed
---
yaml --- r: 187343 b: refs/heads/try c: ad73cb0 h: refs/heads/master i: 187341: cd15c51 187339: 801b021 187335: c0f643a 187327: 2fb0c5b v: v3
1 parent 0a8645d commit 2c5664c

File tree

226 files changed

+3138
-1657
lines changed

Some content is hidden

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

226 files changed

+3138
-1657
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: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: a9f6f4b73e838e83538d4544141d8354b4633aed
5+
refs/heads/try: ad73cb0e18da41d020c70efeadac32969d01716c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/reference.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,7 @@ fn needs_foo_or_bar() {
21652165
21662166
// This function is only included when compiling for a unixish OS with a 32-bit
21672167
// architecture
2168-
#[cfg(all(unix, target_word_size = "32"))]
2168+
#[cfg(all(unix, target_pointer_width = "32"))]
21692169
fn on_32bit_unix() {
21702170
// ...
21712171
}
@@ -2193,9 +2193,9 @@ The following configurations must be defined by the implementation:
21932193
* `target_os = "..."`. Operating system of the target, examples include
21942194
`"win32"`, `"macos"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
21952195
`"bitrig"` or `"openbsd"`.
2196-
* `target_word_size = "..."`. Target word size in bits. This is set to `"32"`
2197-
for targets with 32-bit pointers, and likewise set to `"64"` for 64-bit
2198-
pointers.
2196+
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
2197+
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
2198+
64-bit pointers.
21992199
* `unix`. See `target_family`.
22002200
* `windows`. See `target_family`.
22012201

branches/try/src/doc/rust.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
/* General structure */
5757

5858
body {
59+
background-color: white;
5960
margin: 0 auto;
6061
padding: 0 15px;
6162
font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ macro_rules! vec {
7373
};
7474
}
7575
# fn main() {
76-
# assert_eq!(&[1,2,3], &vec![1,2,3]);
76+
# assert_eq!([1,2,3], vec![1,2,3]);
7777
# }
7878
```
7979

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,16 @@ duration a *lifetime*. Let's try a more complex example:
361361

362362
```{rust}
363363
fn main() {
364-
let x = &mut 5;
364+
let mut x = 5;
365365
366-
if *x < 10 {
366+
if x < 10 {
367367
let y = &x;
368368
369369
println!("Oh no: {}", y);
370370
return;
371371
}
372372
373-
*x -= 1;
373+
x -= 1;
374374
375375
println!("Oh no: {}", x);
376376
}
@@ -382,17 +382,18 @@ mutated, and therefore, lets us pass. This wouldn't work:
382382

383383
```{rust,ignore}
384384
fn main() {
385-
let x = &mut 5;
385+
let mut x = 5;
386386
387-
if *x < 10 {
387+
if x < 10 {
388388
let y = &x;
389-
*x -= 1;
389+
390+
x -= 1;
390391
391392
println!("Oh no: {}", y);
392393
return;
393394
}
394395
395-
*x -= 1;
396+
x -= 1;
396397
397398
println!("Oh no: {}", x);
398399
}
@@ -401,12 +402,12 @@ fn main() {
401402
It gives this error:
402403

403404
```text
404-
test.rs:5:8: 5:10 error: cannot assign to `*x` because it is borrowed
405-
test.rs:5 *x -= 1;
406-
^~
407-
test.rs:4:16: 4:18 note: borrow of `*x` occurs here
408-
test.rs:4 let y = &x;
409-
^~
405+
test.rs:7:9: 7:15 error: cannot assign to `x` because it is borrowed
406+
test.rs:7 x -= 1;
407+
^~~~~~
408+
test.rs:5:18: 5:19 note: borrow of `x` occurs here
409+
test.rs:5 let y = &x;
410+
^
410411
```
411412

412413
As you might guess, this kind of analysis is complex for a human, and therefore

branches/try/src/doc/trpl/static-and-dynamic-dispatch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ dynamic dispatch is sometimes more efficient.
9393

9494
However, the common case is that it is more efficient to use static dispatch,
9595
and one can always have a thin statically-dispatched wrapper function that does
96-
a dynamic, but not vice versa, meaning static calls are more flexible. The
97-
standard library tries to be statically dispatched where possible for this
96+
a dynamic dispatch, but not vice versa, meaning static calls are more flexible.
97+
The standard library tries to be statically dispatched where possible for this
9898
reason.
9999

100100
## Dynamic dispatch

branches/try/src/libcollections/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ impl<T: Ord> BinaryHeap<T> {
480480
/// heap.push(3);
481481
///
482482
/// let vec = heap.into_sorted_vec();
483-
/// assert_eq!(vec, vec![1, 2, 3, 4, 5, 6, 7]);
483+
/// assert_eq!(vec, [1, 2, 3, 4, 5, 6, 7]);
484484
/// ```
485485
pub fn into_sorted_vec(mut self) -> Vec<T> {
486486
let mut end = self.len();

branches/try/src/libcollections/bit.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,13 +640,13 @@ impl BitVec {
640640
/// let mut bv = BitVec::from_elem(3, true);
641641
/// bv.set(1, false);
642642
///
643-
/// assert_eq!(bv.to_bytes(), vec!(0b10100000));
643+
/// assert_eq!(bv.to_bytes(), [0b10100000]);
644644
///
645645
/// let mut bv = BitVec::from_elem(9, false);
646646
/// bv.set(2, true);
647647
/// bv.set(8, true);
648648
///
649-
/// assert_eq!(bv.to_bytes(), vec!(0b00100000, 0b10000000));
649+
/// assert_eq!(bv.to_bytes(), [0b00100000, 0b10000000]);
650650
/// ```
651651
pub fn to_bytes(&self) -> Vec<u8> {
652652
fn bit(bit_vec: &BitVec, byte: usize, bit: usize) -> u8 {
@@ -806,7 +806,7 @@ impl BitVec {
806806
/// let mut bv = BitVec::from_bytes(&[0b01001011]);
807807
/// bv.grow(2, true);
808808
/// assert_eq!(bv.len(), 10);
809-
/// assert_eq!(bv.to_bytes(), vec!(0b01001011, 0b11000000));
809+
/// assert_eq!(bv.to_bytes(), [0b01001011, 0b11000000]);
810810
/// ```
811811
pub fn grow(&mut self, n: usize, value: bool) {
812812
// Note: we just bulk set all the bits in the last word in this fn in multiple places
@@ -2285,12 +2285,12 @@ mod tests {
22852285
fn test_to_bytes() {
22862286
let mut bv = BitVec::from_elem(3, true);
22872287
bv.set(1, false);
2288-
assert_eq!(bv.to_bytes(), vec!(0b10100000));
2288+
assert_eq!(bv.to_bytes(), [0b10100000]);
22892289

22902290
let mut bv = BitVec::from_elem(9, false);
22912291
bv.set(2, true);
22922292
bv.set(8, true);
2293-
assert_eq!(bv.to_bytes(), vec!(0b00100000, 0b10000000));
2293+
assert_eq!(bv.to_bytes(), [0b00100000, 0b10000000]);
22942294
}
22952295

22962296
#[test]
@@ -2675,7 +2675,7 @@ mod bit_set_test {
26752675
let bit_vec: BitSet = usizes.into_iter().collect();
26762676

26772677
let idxs: Vec<_> = bit_vec.iter().collect();
2678-
assert_eq!(idxs, vec![0, 2, 3]);
2678+
assert_eq!(idxs, [0, 2, 3]);
26792679

26802680
let long: BitSet = (0..10000).filter(|&n| n % 2 == 0).collect();
26812681
let real: Vec<_> = range_step(0, 10000, 2).collect();

branches/try/src/libcollections/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<T> ToOwned for T where T: Clone {
132132
/// ```rust
133133
/// use std::borrow::Cow;
134134
///
135-
/// fn abs_all(input: &mut Cow<[int]>) {
135+
/// fn abs_all(input: &mut Cow<[i32]>) {
136136
/// for i in 0..input.len() {
137137
/// let v = input[i];
138138
/// if v < 0 {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ impl<K, V> BTreeMap<K, V> {
12811281
/// a.insert(2, "b");
12821282
///
12831283
/// let keys: Vec<usize> = a.keys().cloned().collect();
1284-
/// assert_eq!(keys, vec![1,2,]);
1284+
/// assert_eq!(keys, [1, 2]);
12851285
/// ```
12861286
#[stable(feature = "rust1", since = "1.0.0")]
12871287
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
@@ -1303,7 +1303,7 @@ impl<K, V> BTreeMap<K, V> {
13031303
/// a.insert(2, "b");
13041304
///
13051305
/// let values: Vec<&str> = a.values().cloned().collect();
1306-
/// assert_eq!(values, vec!["a","b"]);
1306+
/// assert_eq!(values, ["a", "b"]);
13071307
/// ```
13081308
#[stable(feature = "rust1", since = "1.0.0")]
13091309
pub fn values<'a>(&'a self) -> Values<'a, K, V> {

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<T> BTreeSet<T> {
121121
/// }
122122
///
123123
/// let v: Vec<usize> = set.iter().cloned().collect();
124-
/// assert_eq!(v, vec![1,2,3,4]);
124+
/// assert_eq!(v, [1, 2, 3, 4]);
125125
/// ```
126126
#[stable(feature = "rust1", since = "1.0.0")]
127127
pub fn iter(&self) -> Iter<T> {
@@ -138,7 +138,7 @@ impl<T> BTreeSet<T> {
138138
/// let set: BTreeSet<usize> = [1, 2, 3, 4].iter().cloned().collect();
139139
///
140140
/// let v: Vec<usize> = set.into_iter().collect();
141-
/// assert_eq!(v, vec![1,2,3,4]);
141+
/// assert_eq!(v, [1, 2, 3, 4]);
142142
/// ```
143143
#[stable(feature = "rust1", since = "1.0.0")]
144144
pub fn into_iter(self) -> IntoIter<T> {
@@ -197,7 +197,7 @@ impl<T: Ord> BTreeSet<T> {
197197
/// b.insert(3);
198198
///
199199
/// let diff: Vec<usize> = a.difference(&b).cloned().collect();
200-
/// assert_eq!(diff, vec![1]);
200+
/// assert_eq!(diff, [1]);
201201
/// ```
202202
#[stable(feature = "rust1", since = "1.0.0")]
203203
pub fn difference<'a>(&'a self, other: &'a BTreeSet<T>) -> Difference<'a, T> {
@@ -220,7 +220,7 @@ impl<T: Ord> BTreeSet<T> {
220220
/// b.insert(3);
221221
///
222222
/// let sym_diff: Vec<usize> = a.symmetric_difference(&b).cloned().collect();
223-
/// assert_eq!(sym_diff, vec![1,3]);
223+
/// assert_eq!(sym_diff, [1, 3]);
224224
/// ```
225225
#[stable(feature = "rust1", since = "1.0.0")]
226226
pub fn symmetric_difference<'a>(&'a self, other: &'a BTreeSet<T>)
@@ -244,7 +244,7 @@ impl<T: Ord> BTreeSet<T> {
244244
/// b.insert(3);
245245
///
246246
/// let intersection: Vec<usize> = a.intersection(&b).cloned().collect();
247-
/// assert_eq!(intersection, vec![2]);
247+
/// assert_eq!(intersection, [2]);
248248
/// ```
249249
#[stable(feature = "rust1", since = "1.0.0")]
250250
pub fn intersection<'a>(&'a self, other: &'a BTreeSet<T>)
@@ -266,7 +266,7 @@ impl<T: Ord> BTreeSet<T> {
266266
/// b.insert(2);
267267
///
268268
/// let union: Vec<usize> = a.union(&b).cloned().collect();
269-
/// assert_eq!(union, vec![1,2]);
269+
/// assert_eq!(union, [1, 2]);
270270
/// ```
271271
#[stable(feature = "rust1", since = "1.0.0")]
272272
pub fn union<'a>(&'a self, other: &'a BTreeSet<T>) -> Union<'a, T> {
@@ -534,7 +534,7 @@ impl<'a, 'b, T: Ord + Clone> Sub<&'b BTreeSet<T>> for &'a BTreeSet<T> {
534534
///
535535
/// let result = &a - &b;
536536
/// let result_vec: Vec<_> = result.into_iter().collect();
537-
/// assert_eq!(result_vec, vec![1, 2]);
537+
/// assert_eq!(result_vec, [1, 2]);
538538
/// ```
539539
fn sub(self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
540540
self.difference(rhs).cloned().collect()
@@ -557,7 +557,7 @@ impl<'a, 'b, T: Ord + Clone> BitXor<&'b BTreeSet<T>> for &'a BTreeSet<T> {
557557
///
558558
/// let result = &a ^ &b;
559559
/// let result_vec: Vec<_> = result.into_iter().collect();
560-
/// assert_eq!(result_vec, vec![1, 4]);
560+
/// assert_eq!(result_vec, [1, 4]);
561561
/// ```
562562
fn bitxor(self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
563563
self.symmetric_difference(rhs).cloned().collect()
@@ -580,7 +580,7 @@ impl<'a, 'b, T: Ord + Clone> BitAnd<&'b BTreeSet<T>> for &'a BTreeSet<T> {
580580
///
581581
/// let result = &a & &b;
582582
/// let result_vec: Vec<_> = result.into_iter().collect();
583-
/// assert_eq!(result_vec, vec![2, 3]);
583+
/// assert_eq!(result_vec, [2, 3]);
584584
/// ```
585585
fn bitand(self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
586586
self.intersection(rhs).cloned().collect()
@@ -603,7 +603,7 @@ impl<'a, 'b, T: Ord + Clone> BitOr<&'b BTreeSet<T>> for &'a BTreeSet<T> {
603603
///
604604
/// let result = &a | &b;
605605
/// let result_vec: Vec<_> = result.into_iter().collect();
606-
/// assert_eq!(result_vec, vec![1, 2, 3, 4, 5]);
606+
/// assert_eq!(result_vec, [1, 2, 3, 4, 5]);
607607
/// ```
608608
fn bitor(self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
609609
self.union(rhs).cloned().collect()

branches/try/src/libcollections/enum_set.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -428,19 +428,19 @@ mod test {
428428

429429
e1.insert(A);
430430
let elems: ::vec::Vec<_> = e1.iter().collect();
431-
assert_eq!(vec![A], elems);
431+
assert_eq!([A], elems);
432432

433433
e1.insert(C);
434434
let elems: ::vec::Vec<_> = e1.iter().collect();
435-
assert_eq!(vec![A,C], elems);
435+
assert_eq!([A,C], elems);
436436

437437
e1.insert(C);
438438
let elems: ::vec::Vec<_> = e1.iter().collect();
439-
assert_eq!(vec![A,C], elems);
439+
assert_eq!([A,C], elems);
440440

441441
e1.insert(B);
442442
let elems: ::vec::Vec<_> = e1.iter().collect();
443-
assert_eq!(vec![A,B,C], elems);
443+
assert_eq!([A,B,C], elems);
444444
}
445445

446446
///////////////////////////////////////////////////////////////////////////
@@ -458,35 +458,35 @@ mod test {
458458

459459
let e_union = e1 | e2;
460460
let elems: ::vec::Vec<_> = e_union.iter().collect();
461-
assert_eq!(vec![A,B,C], elems);
461+
assert_eq!([A,B,C], elems);
462462

463463
let e_intersection = e1 & e2;
464464
let elems: ::vec::Vec<_> = e_intersection.iter().collect();
465-
assert_eq!(vec![C], elems);
465+
assert_eq!([C], elems);
466466

467467
// Another way to express intersection
468468
let e_intersection = e1 - (e1 - e2);
469469
let elems: ::vec::Vec<_> = e_intersection.iter().collect();
470-
assert_eq!(vec![C], elems);
470+
assert_eq!([C], elems);
471471

472472
let e_subtract = e1 - e2;
473473
let elems: ::vec::Vec<_> = e_subtract.iter().collect();
474-
assert_eq!(vec![A], elems);
474+
assert_eq!([A], elems);
475475

476476
// Bitwise XOR of two sets, aka symmetric difference
477477
let e_symmetric_diff = e1 ^ e2;
478478
let elems: ::vec::Vec<_> = e_symmetric_diff.iter().collect();
479-
assert_eq!(vec![A,B], elems);
479+
assert_eq!([A,B], elems);
480480

481481
// Another way to express symmetric difference
482482
let e_symmetric_diff = (e1 - e2) | (e2 - e1);
483483
let elems: ::vec::Vec<_> = e_symmetric_diff.iter().collect();
484-
assert_eq!(vec![A,B], elems);
484+
assert_eq!([A,B], elems);
485485

486486
// Yet another way to express symmetric difference
487487
let e_symmetric_diff = (e1 | e2) - (e1 & e2);
488488
let elems: ::vec::Vec<_> = e_symmetric_diff.iter().collect();
489-
assert_eq!(vec![A,B], elems);
489+
assert_eq!([A,B], elems);
490490
}
491491

492492
#[test]

branches/try/src/libcollections/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@
404404
#![stable(feature = "rust1", since = "1.0.0")]
405405

406406
pub use core::fmt::{Formatter, Result, Write, rt};
407-
pub use core::fmt::{Show, String, Octal, Binary};
407+
pub use core::fmt::{Octal, Binary};
408408
pub use core::fmt::{Display, Debug};
409409
pub use core::fmt::{LowerHex, UpperHex, Pointer};
410410
pub use core::fmt::{LowerExp, UpperExp};

branches/try/src/libcollections/linked_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ impl<'a, A> IterMut<'a, A> {
777777
/// }
778778
/// {
779779
/// let vec: Vec<_> = list.into_iter().collect();
780-
/// assert_eq!(vec, vec![1, 2, 3, 4]);
780+
/// assert_eq!(vec, [1, 2, 3, 4]);
781781
/// }
782782
/// ```
783783
#[inline]
@@ -1273,7 +1273,7 @@ mod tests {
12731273
}
12741274
check_links(&m);
12751275
assert_eq!(m.len(), 3 + len * 2);
1276-
assert_eq!(m.into_iter().collect::<Vec<_>>(), vec![-2,0,1,2,3,4,5,6,7,8,9,0,1]);
1276+
assert_eq!(m.into_iter().collect::<Vec<_>>(), [-2,0,1,2,3,4,5,6,7,8,9,0,1]);
12771277
}
12781278

12791279
#[test]

branches/try/src/libcollections/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
///
2727
/// ```
2828
/// let v = vec![1; 3];
29-
/// assert_eq!(v, vec![1, 1, 1]);
29+
/// assert_eq!(v, [1, 1, 1]);
3030
/// ```
3131
///
3232
/// Note that unlike array expressions this syntax supports all elements

0 commit comments

Comments
 (0)