Skip to content

Commit d9e9149

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163147 b: refs/heads/snap-stage3 c: 8dcdd1e h: refs/heads/master i: 163145: 2d4586b 163143: 3396fac v: v3
1 parent bae11da commit d9e9149

File tree

391 files changed

+2259
-4554
lines changed

Some content is hidden

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

391 files changed

+2259
-4554
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: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d0ad3c7f933d575d3700d8f5124e5474dfcdbd63
4+
refs/heads/snap-stage3: 8dcdd1e76a6524de7da8423bc9f224fe8a822bc8
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ pub enum Mode {
2525
Codegen
2626
}
2727

28-
impl Copy for Mode {}
29-
3028
impl FromStr for Mode {
3129
fn from_str(s: &str) -> Option<Mode> {
3230
match s {

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
346346
desc: test::TestDesc {
347347
name: make_test_name(config, testfile),
348348
ignore: header::is_test_ignored(config, testfile),
349-
should_fail: test::ShouldFail::No,
349+
should_fail: false
350350
},
351351
testfn: f(),
352352
}

branches/snap-stage3/src/doc/guide-ownership.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ must have a deallocation for each allocation. Rust handles this for you. It
9393
knows that our handle, `x`, is the owning reference to our box. Rust knows that
9494
`x` will go out of scope at the end of the block, and so it inserts a call to
9595
deallocate the memory at the end of the scope. Because the compiler does this
96-
for us, it's impossible to forget. We always have exactly one deallocation paired
96+
for us, it's impossible to forget. We always exaclty one deallocations paired
9797
with each of our allocations.
9898

9999
This is pretty straightforward, but what happens when we want to pass our box
@@ -186,11 +186,11 @@ This function takes ownership, because it takes a `Box`, which owns its
186186
contents. But then we give ownership right back.
187187

188188
In the physical world, you can give one of your possessions to someone for a
189-
short period of time. You still own your possession, you're just letting someone
189+
short period of time. You still own your posession, you're just letting someone
190190
else use it for a while. We call that 'lending' something to someone, and that
191191
person is said to be 'borrowing' that something from you.
192192

193-
Rust's ownership system also allows an owner to lend out a handle for a limited
193+
Rust's ownershp system also allows an owner to lend out a handle for a limited
194194
period. This is also called 'borrowing.' Here's a version of `add_one` which
195195
borrows its argument rather than taking ownership:
196196

@@ -231,7 +231,7 @@ fn add_one(num: &int) -> int {
231231

232232
Rust has a feature called 'lifetime elision,' which allows you to not write
233233
lifetime annotations in certain circumstances. This is one of them. Without
234-
eliding the lifetimes, `add_one` looks like this:
234+
eliding the liftimes, `add_one` looks like this:
235235

236236
```rust
237237
fn add_one<'a>(num: &'a int) -> int {
@@ -254,7 +254,7 @@ This part _declares_ our lifetimes. This says that `add_one` has one lifetime,
254254
fn add_two<'a, 'b>(...)
255255
```
256256

257-
Then in our parameter list, we use the lifetimes we've named:
257+
Then in our parameter list, we use the liftimes we've named:
258258

259259
```{rust,ignore}
260260
...(num: &'a int) -> ...
@@ -279,7 +279,7 @@ fn main() {
279279
}
280280
```
281281

282-
As you can see, `struct`s can also have lifetimes. In a similar way to functions,
282+
As you can see, `struct`s can also have liftimes. In a similar way to functions,
283283

284284
```{rust}
285285
struct Foo<'a> {
@@ -295,7 +295,7 @@ x: &'a int,
295295
# }
296296
```
297297

298-
uses it. So why do we need a lifetime here? We need to ensure that any reference
298+
uses it. So why do we need a liftime here? We need to ensure that any reference
299299
to a `Foo` cannot outlive the reference to an `int` it contains.
300300

301301
## Thinking in scopes

branches/snap-stage3/src/doc/guide-testing.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@ fn test_out_of_bounds_failure() {
8989
}
9090
~~~
9191

92-
`#[should_fail]` tests can be fragile as it's hard to guarantee that the test
93-
didn't fail for an unexpected reason. To help with this, an optional `expected`
94-
parameter can be added to the `should_fail` attribute. The test harness will
95-
make sure that the failure message contains the provided text. A safer version
96-
of the example above would be:
97-
98-
~~~test_harness
99-
#[test]
100-
#[should_fail(expected = "index out of bounds")]
101-
fn test_out_of_bounds_failure() {
102-
let v: &[int] = &[];
103-
v[0];
104-
}
105-
~~~
106-
10792
A test runner built with the `--test` flag supports a limited set of
10893
arguments to control which tests are run:
10994

branches/snap-stage3/src/doc/guide-unsafe.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,6 @@ extern {
661661
fn abort() -> !;
662662
}
663663
664-
#[lang = "owned_box"]
665-
pub struct Box<T>(*mut T);
666-
667664
#[lang="exchange_malloc"]
668665
unsafe fn allocate(size: uint, _align: uint) -> *mut u8 {
669666
let p = libc::malloc(size as libc::size_t) as *mut u8;

branches/snap-stage3/src/doc/guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3681,8 +3681,8 @@ Here's the second note, which lets us know where the first borrow would be over.
36813681
This is useful, because if we wait to try to borrow `x` after this borrow is
36823682
over, then everything will work.
36833683

3684-
For more advanced patterns, please consult the [Ownership
3685-
Guide](guide-ownership.html). You'll also learn what this type signature with
3684+
For more advanced patterns, please consult the [Lifetime
3685+
Guide](guide-lifetimes.html). You'll also learn what this type signature with
36863686
the `'a` syntax is:
36873687

36883688
```{rust,ignore}

branches/snap-stage3/src/doc/reference.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,6 @@ Implementations are defined with the keyword `impl`.
16601660

16611661
```
16621662
# struct Point {x: f64, y: f64};
1663-
# impl Copy for Point {}
16641663
# type Surface = int;
16651664
# struct BoundingBox {x: f64, y: f64, width: f64, height: f64};
16661665
# trait Shape { fn draw(&self, Surface); fn bounding_box(&self) -> BoundingBox; }
@@ -1670,8 +1669,6 @@ struct Circle {
16701669
center: Point,
16711670
}
16721671
1673-
impl Copy for Circle {}
1674-
16751672
impl Shape for Circle {
16761673
fn draw(&self, s: Surface) { do_draw_circle(s, *self); }
16771674
fn bounding_box(&self) -> BoundingBox {
@@ -1794,7 +1791,6 @@ default visibility with the `priv` keyword. When an item is declared as `pub`,
17941791
it can be thought of as being accessible to the outside world. For example:
17951792

17961793
```
1797-
# #![allow(missing_copy_implementations)]
17981794
# fn main() {}
17991795
// Declare a private struct
18001796
struct Foo;

branches/snap-stage3/src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ mod tests {
523523
#[test]
524524
fn show_arc() {
525525
let a = Arc::new(5u32);
526-
assert!(format!("{}", a) == "5")
526+
assert!(format!("{}", a).as_slice() == "5")
527527
}
528528

529529
// Make sure deriving works with Arc<T>

branches/snap-stage3/src/liballoc/boxed.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ mod test {
170170
let b = box Test as Box<Any>;
171171
let a_str = a.to_str();
172172
let b_str = b.to_str();
173-
assert_eq!(a_str, "Box<Any>");
174-
assert_eq!(b_str, "Box<Any>");
173+
assert_eq!(a_str.as_slice(), "Box<Any>");
174+
assert_eq!(b_str.as_slice(), "Box<Any>");
175175

176176
let a = &8u as &Any;
177177
let b = &Test as &Any;
178178
let s = format!("{}", a);
179-
assert_eq!(s, "&Any");
179+
assert_eq!(s.as_slice(), "&Any");
180180
let s = format!("{}", b);
181-
assert_eq!(s, "&Any");
181+
assert_eq!(s.as_slice(), "&Any");
182182
}
183183
}

branches/snap-stage3/src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ impl<T> TypedArena<T> {
466466
}
467467

468468
let ptr: &mut T = unsafe {
469-
let ptr: &mut T = mem::transmute(self.ptr.clone());
469+
let ptr: &mut T = mem::transmute(self.ptr);
470470
ptr::write(ptr, object);
471471
self.ptr.set(self.ptr.get().offset(1));
472472
ptr

branches/snap-stage3/src/libcollections/binary_heap.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
//! position: uint
3636
//! }
3737
//!
38-
//! impl Copy for State {}
39-
//!
4038
//! // The priority queue depends on `Ord`.
4139
//! // Explicitly implement the trait so the queue becomes a min-heap
4240
//! // instead of a max-heap.
@@ -487,7 +485,7 @@ impl<T: Ord> BinaryHeap<T> {
487485
let mut end = q.len();
488486
while end > 1 {
489487
end -= 1;
490-
q.data.swap(0, end);
488+
q.data.as_mut_slice().swap(0, end);
491489
q.siftdown_range(0, end)
492490
}
493491
q.into_vec()
@@ -771,8 +769,8 @@ mod tests {
771769
v.sort();
772770
data.sort();
773771

774-
assert_eq!(v, data);
775-
assert_eq!(heap.into_sorted_vec(), data);
772+
assert_eq!(v.as_slice(), data.as_slice());
773+
assert_eq!(heap.into_sorted_vec().as_slice(), data.as_slice());
776774
}
777775

778776
#[test]
@@ -814,7 +812,7 @@ mod tests {
814812
fn test_from_iter() {
815813
let xs = vec!(9u, 8, 7, 6, 5, 4, 3, 2, 1);
816814

817-
let mut q: BinaryHeap<uint> = xs.iter().rev().map(|&x| x).collect();
815+
let mut q: BinaryHeap<uint> = xs.as_slice().iter().rev().map(|&x| x).collect();
818816

819817
for &x in xs.iter() {
820818
assert_eq!(q.pop().unwrap(), x);

branches/snap-stage3/src/libcollections/bit.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,10 +1692,10 @@ mod tests {
16921692
#[test]
16931693
fn test_to_str() {
16941694
let zerolen = Bitv::new();
1695-
assert_eq!(zerolen.to_string(), "");
1695+
assert_eq!(zerolen.to_string().as_slice(), "");
16961696

16971697
let eightbits = Bitv::with_capacity(8u, false);
1698-
assert_eq!(eightbits.to_string(), "00000000")
1698+
assert_eq!(eightbits.to_string().as_slice(), "00000000")
16991699
}
17001700

17011701
#[test]
@@ -1718,7 +1718,7 @@ mod tests {
17181718
let mut b = bitv::Bitv::with_capacity(2, false);
17191719
b.set(0, true);
17201720
b.set(1, false);
1721-
assert_eq!(b.to_string(), "10");
1721+
assert_eq!(b.to_string().as_slice(), "10");
17221722
}
17231723

17241724
#[test]
@@ -2029,7 +2029,7 @@ mod tests {
20292029
fn test_from_bytes() {
20302030
let bitv = from_bytes(&[0b10110110, 0b00000000, 0b11111111]);
20312031
let str = format!("{}{}{}", "10110110", "00000000", "11111111");
2032-
assert_eq!(bitv.to_string(), str);
2032+
assert_eq!(bitv.to_string().as_slice(), str.as_slice());
20332033
}
20342034

20352035
#[test]
@@ -2048,7 +2048,7 @@ mod tests {
20482048
fn test_from_bools() {
20492049
let bools = vec![true, false, true, true];
20502050
let bitv: Bitv = bools.iter().map(|n| *n).collect();
2051-
assert_eq!(bitv.to_string(), "1011");
2051+
assert_eq!(bitv.to_string().as_slice(), "1011");
20522052
}
20532053

20542054
#[test]
@@ -2207,7 +2207,7 @@ mod tests {
22072207

22082208
let expected = [3, 5, 11, 77];
22092209
let actual = a.intersection(&b).collect::<Vec<uint>>();
2210-
assert_eq!(actual, expected);
2210+
assert_eq!(actual.as_slice(), expected.as_slice());
22112211
}
22122212

22132213
#[test]
@@ -2226,7 +2226,7 @@ mod tests {
22262226

22272227
let expected = [1, 5, 500];
22282228
let actual = a.difference(&b).collect::<Vec<uint>>();
2229-
assert_eq!(actual, expected);
2229+
assert_eq!(actual.as_slice(), expected.as_slice());
22302230
}
22312231

22322232
#[test]
@@ -2247,7 +2247,7 @@ mod tests {
22472247

22482248
let expected = [1, 5, 11, 14, 220];
22492249
let actual = a.symmetric_difference(&b).collect::<Vec<uint>>();
2250-
assert_eq!(actual, expected);
2250+
assert_eq!(actual.as_slice(), expected.as_slice());
22512251
}
22522252

22532253
#[test]
@@ -2272,7 +2272,7 @@ mod tests {
22722272

22732273
let expected = [1, 3, 5, 9, 11, 13, 19, 24, 160, 200];
22742274
let actual = a.union(&b).collect::<Vec<uint>>();
2275-
assert_eq!(actual, expected);
2275+
assert_eq!(actual.as_slice(), expected.as_slice());
22762276
}
22772277

22782278
#[test]
@@ -2660,7 +2660,7 @@ mod tests {
26602660
s.insert(10);
26612661
s.insert(50);
26622662
s.insert(2);
2663-
assert_eq!("{1, 2, 10, 50}", s.to_string());
2663+
assert_eq!("{1, 2, 10, 50}".to_string(), s.to_string());
26642664
}
26652665

26662666
fn rng() -> rand::IsaacRng {

branches/snap-stage3/src/libcollections/btree/map.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,24 +1026,6 @@ impl<'a, K: Ord, V> OccupiedEntry<'a, K, V> {
10261026

10271027
impl<K, V> BTreeMap<K, V> {
10281028
/// Gets an iterator over the entries of the map.
1029-
///
1030-
/// # Example
1031-
///
1032-
/// ```
1033-
/// use std::collections::BTreeMap;
1034-
///
1035-
/// let mut map = BTreeMap::new();
1036-
/// map.insert(1u, "a");
1037-
/// map.insert(2u, "b");
1038-
/// map.insert(3u, "c");
1039-
///
1040-
/// for (key, value) in map.iter() {
1041-
/// println!("{}: {}", key, value);
1042-
/// }
1043-
///
1044-
/// let (first_key, first_value) = map.iter().next().unwrap();
1045-
/// assert_eq!((*first_key, *first_value), (1u, "a"));
1046-
/// ```
10471029
#[unstable = "matches collection reform specification, waiting for dust to settle"]
10481030
pub fn iter<'a>(&'a self) -> Entries<'a, K, V> {
10491031
let len = self.len();
@@ -1086,38 +1068,12 @@ impl<K, V> BTreeMap<K, V> {
10861068
}
10871069

10881070
/// Gets an iterator over the keys of the map.
1089-
///
1090-
/// # Example
1091-
///
1092-
/// ```
1093-
/// use std::collections::BTreeMap;
1094-
///
1095-
/// let mut a = BTreeMap::new();
1096-
/// a.insert(1u, "a");
1097-
/// a.insert(2u, "b");
1098-
///
1099-
/// let keys: Vec<uint> = a.keys().cloned().collect();
1100-
/// assert_eq!(keys, vec![1u,2,]);
1101-
/// ```
11021071
#[unstable = "matches collection reform specification, waiting for dust to settle"]
11031072
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
11041073
self.iter().map(|(k, _)| k)
11051074
}
11061075

11071076
/// Gets an iterator over the values of the map.
1108-
///
1109-
/// # Example
1110-
///
1111-
/// ```
1112-
/// use std::collections::BTreeMap;
1113-
///
1114-
/// let mut a = BTreeMap::new();
1115-
/// a.insert(1u, "a");
1116-
/// a.insert(2u, "b");
1117-
///
1118-
/// let values: Vec<&str> = a.values().cloned().collect();
1119-
/// assert_eq!(values, vec!["a","b"]);
1120-
/// ```
11211077
#[unstable = "matches collection reform specification, waiting for dust to settle"]
11221078
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
11231079
self.iter().map(|(_, v)| v)

0 commit comments

Comments
 (0)