Skip to content

Commit 0647e1d

Browse files
committed
---
yaml --- r: 136639 b: refs/heads/dist-snap c: c669411 h: refs/heads/master i: 136637: 9dc5d95 136635: 99441ad 136631: b150a42 136623: d85ed6e 136607: e55c599 136575: eabd7ad v: v3
1 parent 48a89b4 commit 0647e1d

File tree

90 files changed

+514
-175
lines changed

Some content is hidden

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

90 files changed

+514
-175
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 189b7332968972f34cdbbbd9b62d97ababf53059
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: c765178bf61bb9f16ef3806deef14b5962336f2d
9+
refs/heads/dist-snap: c669411afa76bdc92369a3a193e9393364d42370
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ If you're just reporting a bug, please see:
44

55
http://doc.rust-lang.org/complement-bugreport.html
66

7+
## Submitting an issue
8+
9+
Please submit issues here for bug reports or implementation details. For feature
10+
requests, language changes, or major changes to the libraries, please submit an
11+
issue against the [RFCs repository](https://github.com/rust-lang/rfcs).
12+
713
## Pull request procedure
814

915
Pull requests should be targeted at Rust's `master` branch.

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,14 +2151,10 @@ In this case, we say `x` is a `uint` explicitly, so Rust is able to properly
21512151
tell `random()` what to generate. In a similar fashion, both of these work:
21522152

21532153
```{rust,ignore}
2154-
let input_num = from_str::<Option<uint>>("5");
2154+
let input_num = from_str::<uint>("5");
21552155
let input_num: Option<uint> = from_str("5");
21562156
```
21572157

2158-
In this case, I happen to prefer the latter, and in the `random()` case, I prefer
2159-
the former. I think the nested `<>`s make the first option especially ugly and
2160-
a bit harder to read.
2161-
21622158
Anyway, with us now converting our input to a number, our code looks like this:
21632159

21642160
```{rust,ignore}

branches/dist-snap/src/doc/intro.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ Here's some code:
300300
use std::sync::Arc;
301301
302302
fn main() {
303-
let numbers = vec![1i, 2i, 3i];
304-
let numbers = Arc::new(numbers);
303+
let numbers = Arc::new(vec![1i, 2i, 3i]);
305304
306305
for num in range(0u, 3) {
307306
let (tx, rx) = channel();
@@ -346,8 +345,7 @@ and modify it to mutate the shared state:
346345
use std::sync::{Arc, Mutex};
347346
348347
fn main() {
349-
let numbers = vec![1i, 2i, 3i];
350-
let numbers_lock = Arc::new(Mutex::new(numbers));
348+
let numbers_lock = Arc::new(Mutex::new(vec![1i, 2i, 3i]));
351349
352350
for num in range(0u, 3) {
353351
let (tx, rx) = channel();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ mod tests {
311311

312312
task::spawn(proc() {
313313
let arc_v: Arc<Vec<int>> = rx.recv();
314-
assert_eq!(*arc_v.get(3), 4);
314+
assert_eq!((*arc_v)[3], 4);
315315
});
316316

317317
tx.send(arc_v.clone());
318318

319-
assert_eq!(*arc_v.get(2), 3);
320-
assert_eq!(*arc_v.get(4), 5);
319+
assert_eq!((*arc_v)[2], 3);
320+
assert_eq!((*arc_v)[4], 5);
321321

322322
info!("{:?}", arc_v);
323323
}

branches/dist-snap/src/libcollections/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub trait MutableMap<K, V>: Map<K, V> + Mutable {
131131
/// let mut map = HashMap::new();
132132
/// assert_eq!(map.insert("key", 2i), true);
133133
/// assert_eq!(map.insert("key", 9i), false);
134-
/// assert_eq!(map.get(&"key"), &9i);
134+
/// assert_eq!(map["key"], 9i);
135135
/// ```
136136
#[inline]
137137
fn insert(&mut self, key: K, value: V) -> bool {
@@ -171,7 +171,7 @@ pub trait MutableMap<K, V>: Map<K, V> + Mutable {
171171
///
172172
/// map.insert("a", 1i);
173173
/// assert_eq!(map.swap("a", 37i), Some(1i));
174-
/// assert_eq!(map.get(&"a"), &37i);
174+
/// assert_eq!(map["a"], 37i);
175175
/// ```
176176
fn swap(&mut self, k: K, v: V) -> Option<V>;
177177

@@ -203,7 +203,7 @@ pub trait MutableMap<K, V>: Map<K, V> + Mutable {
203203
/// Some(x) => *x = 7i,
204204
/// None => (),
205205
/// }
206-
/// assert_eq!(map.get(&"a"), &7i);
206+
/// assert_eq!(map["a"], 7i);
207207
/// ```
208208
fn find_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V>;
209209
}

branches/dist-snap/src/libcollections/ringbuf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ mod tests {
542542
use vec::Vec;
543543

544544
#[test]
545+
#[allow(deprecated)]
545546
fn test_simple() {
546547
let mut d = RingBuf::new();
547548
assert_eq!(d.len(), 0u);
@@ -587,6 +588,7 @@ mod tests {
587588
}
588589

589590
#[test]
591+
#[allow(deprecated)]
590592
fn test_boxes() {
591593
let a: Gc<int> = box(GC) 5;
592594
let b: Gc<int> = box(GC) 72;

branches/dist-snap/src/libcollections/slice.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ mod tests {
904904
}
905905

906906
#[test]
907+
#[allow(deprecated)]
907908
fn test_initn() {
908909
let mut a = vec![11i, 12, 13];
909910
let b: &[int] = &[11, 12, 13];
@@ -1303,6 +1304,7 @@ mod tests {
13031304
}
13041305

13051306
#[test]
1307+
#[allow(deprecated)]
13061308
fn test_bsearch_elem() {
13071309
assert_eq!([1i,2,3,4,5].bsearch_elem(&5), Some(4));
13081310
assert_eq!([1i,2,3,4,5].bsearch_elem(&4), Some(3));
@@ -1350,11 +1352,11 @@ mod tests {
13501352
#[test]
13511353
fn test_reverse() {
13521354
let mut v: Vec<int> = vec![10i, 20];
1353-
assert_eq!(*v.get(0), 10);
1354-
assert_eq!(*v.get(1), 20);
1355+
assert_eq!(v[0], 10);
1356+
assert_eq!(v[1], 20);
13551357
v.reverse();
1356-
assert_eq!(*v.get(0), 20);
1357-
assert_eq!(*v.get(1), 10);
1358+
assert_eq!(v[0], 20);
1359+
assert_eq!(v[1], 10);
13581360

13591361
let mut v3: Vec<int> = vec![];
13601362
v3.reverse();
@@ -1462,6 +1464,7 @@ mod tests {
14621464
}
14631465

14641466
#[test]
1467+
#[allow(deprecated)]
14651468
fn test_shift() {
14661469
let mut x = vec![1i, 2, 3];
14671470
assert_eq!(x.shift(), Some(1));
@@ -1901,6 +1904,7 @@ mod tests {
19011904
}
19021905

19031906
#[test]
1907+
#[allow(deprecated)]
19041908
fn test_copy_from() {
19051909
let mut a = [1i,2,3,4,5];
19061910
let b = [6i,7,8];

branches/dist-snap/src/libcollections/smallintmap.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,11 @@ impl<V:Clone> SmallIntMap<V> {
348348
/// let mut map = SmallIntMap::new();
349349
///
350350
/// // Key does not exist, will do a simple insert
351-
/// assert!(map.update(1, vec![1i, 2], |old, new| old.append(new.as_slice())));
351+
/// assert!(map.update(1, vec![1i, 2], |mut old, new| { old.extend(new.into_iter()); old }));
352352
/// assert_eq!(map[1], vec![1i, 2]);
353353
///
354354
/// // Key exists, update the value
355-
/// assert!(!map.update(1, vec![3i, 4], |old, new| old.append(new.as_slice())));
355+
/// assert!(!map.update(1, vec![3i, 4], |mut old, new| { old.extend(new.into_iter()); old }));
356356
/// assert_eq!(map[1], vec![1i, 2, 3, 4]);
357357
/// ```
358358
pub fn update(&mut self, key: uint, newval: V, ff: |V, V| -> V) -> bool {
@@ -452,7 +452,7 @@ impl<V> Index<uint, V> for SmallIntMap<V> {
452452
}*/
453453

454454
macro_rules! iterator {
455-
(impl $name:ident -> $elem:ty, $getter:ident) => {
455+
(impl $name:ident -> $elem:ty, $($getter:ident),+) => {
456456
impl<'a, T> Iterator<$elem> for $name<'a, T> {
457457
#[inline]
458458
fn next(&mut self) -> Option<$elem> {
@@ -462,7 +462,7 @@ macro_rules! iterator {
462462
if elem.is_some() {
463463
let index = self.front;
464464
self.front += 1;
465-
return Some((index, elem. $getter ()));
465+
return Some((index, elem $(. $getter ())+));
466466
}
467467
}
468468
_ => ()
@@ -481,7 +481,7 @@ macro_rules! iterator {
481481
}
482482

483483
macro_rules! double_ended_iterator {
484-
(impl $name:ident -> $elem:ty, $getter:ident) => {
484+
(impl $name:ident -> $elem:ty, $($getter:ident),+) => {
485485
impl<'a, T> DoubleEndedIterator<$elem> for $name<'a, T> {
486486
#[inline]
487487
fn next_back(&mut self) -> Option<$elem> {
@@ -490,7 +490,7 @@ macro_rules! double_ended_iterator {
490490
Some(elem) => {
491491
if elem.is_some() {
492492
self.back -= 1;
493-
return Some((self.back, elem. $getter ()));
493+
return Some((self.back, elem$(. $getter ())+));
494494
}
495495
}
496496
_ => ()
@@ -510,8 +510,8 @@ pub struct Entries<'a, T:'a> {
510510
iter: slice::Items<'a, Option<T>>
511511
}
512512

513-
iterator!(impl Entries -> (uint, &'a T), get_ref)
514-
double_ended_iterator!(impl Entries -> (uint, &'a T), get_ref)
513+
iterator!(impl Entries -> (uint, &'a T), as_ref, unwrap)
514+
double_ended_iterator!(impl Entries -> (uint, &'a T), as_ref, unwrap)
515515

516516
/// Forward iterator over the key-value pairs of a map, with the
517517
/// values being mutable.
@@ -521,8 +521,8 @@ pub struct MutEntries<'a, T:'a> {
521521
iter: slice::MutItems<'a, Option<T>>
522522
}
523523

524-
iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
525-
double_ended_iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
524+
iterator!(impl MutEntries -> (uint, &'a mut T), as_mut, unwrap)
525+
double_ended_iterator!(impl MutEntries -> (uint, &'a mut T), as_mut, unwrap)
526526

527527
/// Forward iterator over the keys of a map
528528
pub type Keys<'a, T> =

branches/dist-snap/src/libcollections/trie.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ impl<T> TrieMap<T> {
434434
fn bound_mut<'a>(&'a mut self, key: uint, upper: bool) -> MutEntries<'a, T> {
435435
bound!(MutEntries, self = self,
436436
key = key, is_upper = upper,
437-
slice_from = mut_slice_from, iter = mut_iter,
437+
slice_from = slice_from_mut, iter = iter_mut,
438438
mutability = mut)
439439
}
440440

@@ -1020,7 +1020,7 @@ macro_rules! iterator_impl {
10201020
}
10211021

10221022
iterator_impl! { Entries, iter = iter, mutability = }
1023-
iterator_impl! { MutEntries, iter = mut_iter, mutability = mut }
1023+
iterator_impl! { MutEntries, iter = iter_mut, mutability = mut }
10241024

10251025
/// A forward iterator over a set.
10261026
pub struct SetItems<'a> {

branches/dist-snap/src/libcollections/vec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ impl<T> Vec<T> {
960960
/// # Example
961961
///
962962
/// ```
963+
/// #![allow(deprecated)]
963964
/// let vec = vec![1i, 2, 3, 4];
964965
/// assert!(vec.tailn(2) == [3, 4]);
965966
/// ```
@@ -1065,6 +1066,7 @@ impl<T> Vec<T> {
10651066
/// # Example
10661067
///
10671068
/// ```
1069+
/// #![allow(deprecated)]
10681070
/// let mut vec = vec![1i, 2, 3];
10691071
/// assert!(vec.shift() == Some(1));
10701072
/// assert_eq!(vec, vec![2, 3]);

branches/dist-snap/src/libcore/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub enum Void { }
9494
pub trait Any: AnyPrivate {}
9595

9696
/// An inner trait to ensure that only this module can call `get_type_id()`.
97-
trait AnyPrivate {
97+
pub trait AnyPrivate {
9898
/// Get the `TypeId` of `self`
9999
fn get_type_id(&self) -> TypeId;
100100
}

branches/dist-snap/src/libcore/clone.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ the `clone` method.
2525

2626
/// A common trait for cloning an object.
2727
pub trait Clone {
28-
/// Returns a copy of the value. The contents of owned pointers
29-
/// are copied to maintain uniqueness, while the contents of
30-
/// managed pointers are not copied.
28+
/// Returns a copy of the value.
3129
fn clone(&self) -> Self;
3230

3331
/// Perform copy-assignment from `source`.

branches/dist-snap/src/libcore/iter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,6 @@ pub type Iterate<'a, T> = Unfold<'a, T, IterateState<'a, T>>;
21782178

21792179
/// Creates a new iterator that produces an infinite sequence of
21802180
/// repeated applications of the given function `f`.
2181-
#[allow(visible_private_types)]
21822181
pub fn iterate<'a, T: Clone>(seed: T, f: |T|: 'a -> T) -> Iterate<'a, T> {
21832182
Unfold::new((f, Some(seed), true), |st| {
21842183
let &(ref mut f, ref mut val, ref mut first) = st;

branches/dist-snap/src/libcore/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,11 +1062,11 @@ pub trait MutableCloneableSlice<T> {
10621062
/// let mut dst = [0i, 0, 0];
10631063
/// let src = [1i, 2];
10641064
///
1065-
/// assert!(dst.copy_from(src) == 2);
1065+
/// assert!(dst.clone_from_slice(src) == 2);
10661066
/// assert!(dst == [1, 2, 0]);
10671067
///
10681068
/// let src2 = [3i, 4, 5, 6];
1069-
/// assert!(dst.copy_from(src2) == 3);
1069+
/// assert!(dst.clone_from_slice(src2) == 3);
10701070
/// assert!(dst == [3i, 4, 5]);
10711071
/// ```
10721072
fn clone_from_slice(self, &[T]) -> uint;

branches/dist-snap/src/libcoretest/cmp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ fn test_ordering_order() {
4242
}
4343

4444
#[test]
45+
#[allow(deprecated)]
4546
fn test_lexical_ordering() {
4647
fn t(o1: Ordering, o2: Ordering, e: Ordering) {
4748
assert_eq!(lexical_ordering(o1, o2), e);

branches/dist-snap/src/libcoretest/option.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ fn test_ord() {
244244
}
245245

246246
#[test]
247+
#[allow(deprecated)]
247248
fn test_mutate() {
248249
let mut x = Some(3i);
249250
assert!(x.mutate(|i| i+1));

branches/dist-snap/src/libdebug/repr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ macro_rules! try( ($me:expr, $e:expr) => (
3232

3333
/// Representations
3434
35-
trait Repr {
35+
pub trait Repr {
3636
fn write_repr(&self, writer: &mut io::Writer) -> io::IoResult<()>;
3737
}
3838

branches/dist-snap/src/libgetopts/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ mod tests {
11421142
Ok(ref m) => {
11431143
// The next variable after the flag is just a free argument
11441144

1145-
assert!(*m.free.get(0) == "20".to_string());
1145+
assert!(m.free[0] == "20".to_string());
11461146
}
11471147
_ => fail!()
11481148
}
@@ -1298,8 +1298,8 @@ mod tests {
12981298
assert!(m.opt_present("t"));
12991299
assert_eq!(m.opt_str("t").unwrap(), "20".to_string());
13001300
let pair = m.opt_strs("test");
1301-
assert!(*pair.get(0) == "20".to_string());
1302-
assert!(*pair.get(1) == "30".to_string());
1301+
assert!(pair[0] == "20".to_string());
1302+
assert!(pair[1] == "30".to_string());
13031303
}
13041304
_ => fail!()
13051305
}
@@ -1351,19 +1351,19 @@ mod tests {
13511351
let rs = getopts(args.as_slice(), opts.as_slice());
13521352
match rs {
13531353
Ok(ref m) => {
1354-
assert!(*m.free.get(0) == "prog".to_string());
1355-
assert!(*m.free.get(1) == "free1".to_string());
1354+
assert!(m.free[0] == "prog".to_string());
1355+
assert!(m.free[1] == "free1".to_string());
13561356
assert_eq!(m.opt_str("s").unwrap(), "20".to_string());
1357-
assert!(*m.free.get(2) == "free2".to_string());
1357+
assert!(m.free[2] == "free2".to_string());
13581358
assert!((m.opt_present("flag")));
13591359
assert_eq!(m.opt_str("long").unwrap(), "30".to_string());
13601360
assert!((m.opt_present("f")));
13611361
let pair = m.opt_strs("m");
1362-
assert!(*pair.get(0) == "40".to_string());
1363-
assert!(*pair.get(1) == "50".to_string());
1362+
assert!(pair[0] == "40".to_string());
1363+
assert!(pair[1] == "50".to_string());
13641364
let pair = m.opt_strs("n");
1365-
assert!(*pair.get(0) == "-A B".to_string());
1366-
assert!(*pair.get(1) == "-60 70".to_string());
1365+
assert!(pair[0] == "-A B".to_string());
1366+
assert!(pair[1] == "-60 70".to_string());
13671367
assert!((!m.opt_present("notpresent")));
13681368
}
13691369
_ => fail!()

branches/dist-snap/src/libglob/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ impl Pattern {
336336
* # Example
337337
*
338338
* ```rust
339+
* #![allow(deprecated)]
339340
* use glob::Pattern;
340341
*
341342
* assert!(Pattern::new("c?t").matches("cat"));

0 commit comments

Comments
 (0)