Skip to content

Commit 50639dd

Browse files
committed
---
yaml --- r: 212663 b: refs/heads/tmp c: 2ff4243 h: refs/heads/master i: 212661: ee66ad2 212659: 39623c2 212655: 2b9d42d v: v3
1 parent 285e271 commit 50639dd

File tree

64 files changed

+200
-617
lines changed

Some content is hidden

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

64 files changed

+200
-617
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 4efc4ec178f6ddf3c8cd268b011f3a04056f9d16
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: dc72834e2b482e904352fb3442e0450ee0d53190
35+
refs/heads/tmp: 2ff42435c21289cdc668081446ca349f5eb4323c
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: bea1c4a78e5233ea6f85a2028a26e08c26635fca
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/liballoc/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ use core::raw::{TraitObject};
8181
#[lang = "exchange_heap"]
8282
#[unstable(feature = "alloc",
8383
reason = "may be renamed; uncertain about custom allocator design")]
84-
pub const HEAP: () = ();
84+
pub static HEAP: () = ();
8585

8686
/// A pointer type for heap allocation.
8787
///

branches/tmp/src/libcollections/binary_heap.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -760,10 +760,3 @@ impl<T: Ord> Extend<T> for BinaryHeap<T> {
760760
}
761761
}
762762
}
763-
764-
#[stable(feature = "extend_ref", since = "1.2.0")]
765-
impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BinaryHeap<T> {
766-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
767-
self.extend(iter.into_iter().cloned());
768-
}
769-
}

branches/tmp/src/libcollections/bit.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ fn match_words <'a,'b>(a: &'a BitVec, b: &'b BitVec) -> (MatchWords<'a>, MatchWo
125125
}
126126
}
127127

128-
const TRUE: &'static bool = &true;
129-
const FALSE: &'static bool = &false;
128+
static TRUE: bool = true;
129+
static FALSE: bool = false;
130130

131131
/// The bitvector type.
132132
///
@@ -172,9 +172,9 @@ impl Index<usize> for BitVec {
172172
#[inline]
173173
fn index(&self, i: usize) -> &bool {
174174
if self.get(i).expect("index out of bounds") {
175-
TRUE
175+
&TRUE
176176
} else {
177-
FALSE
177+
&FALSE
178178
}
179179
}
180180
}
@@ -1070,13 +1070,6 @@ impl Extend<bool> for BitVec {
10701070
}
10711071
}
10721072

1073-
#[stable(feature = "extend_ref", since = "1.2.0")]
1074-
impl<'a> Extend<&'a bool> for BitVec {
1075-
fn extend<I: IntoIterator<Item=&'a bool>>(&mut self, iter: I) {
1076-
self.extend(iter.into_iter().cloned());
1077-
}
1078-
}
1079-
10801073
#[stable(feature = "rust1", since = "1.0.0")]
10811074
impl Clone for BitVec {
10821075
#[inline]
@@ -1285,13 +1278,6 @@ impl Extend<usize> for BitSet {
12851278
}
12861279
}
12871280

1288-
#[stable(feature = "extend_ref", since = "1.2.0")]
1289-
impl<'a> Extend<&'a usize> for BitSet {
1290-
fn extend<I: IntoIterator<Item=&'a usize>>(&mut self, iter: I) {
1291-
self.extend(iter.into_iter().cloned());
1292-
}
1293-
}
1294-
12951281
#[stable(feature = "rust1", since = "1.0.0")]
12961282
impl PartialOrd for BitSet {
12971283
#[inline]

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -879,13 +879,6 @@ impl<K: Ord, V> Extend<(K, V)> for BTreeMap<K, V> {
879879
}
880880
}
881881

882-
#[stable(feature = "extend_ref", since = "1.2.0")]
883-
impl<'a, K: Ord + Copy, V: Copy> Extend<(&'a K, &'a V)> for BTreeMap<K, V> {
884-
fn extend<I: IntoIterator<Item=(&'a K, &'a V)>>(&mut self, iter: I) {
885-
self.extend(iter.into_iter().map(|(&key, &value)| (key, value)));
886-
}
887-
}
888-
889882
#[stable(feature = "rust1", since = "1.0.0")]
890883
impl<K: Hash, V: Hash> Hash for BTreeMap<K, V> {
891884
fn hash<H: Hasher>(&self, state: &mut H) {

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,6 @@ impl<T: Ord> Extend<T> for BTreeSet<T> {
509509
}
510510
}
511511

512-
#[stable(feature = "extend_ref", since = "1.2.0")]
513-
impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BTreeSet<T> {
514-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
515-
self.extend(iter.into_iter().cloned());
516-
}
517-
}
518-
519512
#[stable(feature = "rust1", since = "1.0.0")]
520513
impl<T: Ord> Default for BTreeSet<T> {
521514
#[stable(feature = "rust1", since = "1.0.0")]

branches/tmp/src/libcollections/enum_set.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,3 @@ impl<E:CLike> Extend<E> for EnumSet<E> {
288288
}
289289
}
290290
}
291-
292-
#[stable(feature = "extend_ref", since = "1.2.0")]
293-
impl<'a, E: 'a + CLike + Copy> Extend<&'a E> for EnumSet<E> {
294-
fn extend<I: IntoIterator<Item=&'a E>>(&mut self, iter: I) {
295-
self.extend(iter.into_iter().cloned());
296-
}
297-
}

branches/tmp/src/libcollections/linked_list.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -904,13 +904,6 @@ impl<A> Extend<A> for LinkedList<A> {
904904
}
905905
}
906906

907-
#[stable(feature = "extend_ref", since = "1.2.0")]
908-
impl<'a, T: 'a + Copy> Extend<&'a T> for LinkedList<T> {
909-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
910-
self.extend(iter.into_iter().cloned());
911-
}
912-
}
913-
914907
#[stable(feature = "rust1", since = "1.0.0")]
915908
impl<A: PartialEq> PartialEq for LinkedList<A> {
916909
fn eq(&self, other: &LinkedList<A>) -> bool {

branches/tmp/src/libcollections/str.rs

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -640,19 +640,16 @@ impl str {
640640
///
641641
/// let v: Vec<&str> = "lion::tiger::leopard".split("::").collect();
642642
/// assert_eq!(v, ["lion", "tiger", "leopard"]);
643-
///
644-
/// let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect();
645-
/// assert_eq!(v, ["abc", "def", "ghi"]);
646-
///
647-
/// let v: Vec<&str> = "lionXtigerXleopard".split(char::is_uppercase).collect();
648-
/// assert_eq!(v, ["lion", "tiger", "leopard"]);
649643
/// ```
650644
///
651-
/// A more complex pattern, using a closure:
645+
/// More complex patterns with closures:
652646
///
653647
/// ```
654-
/// let v: Vec<&str> = "abc1defXghi".split(|c| c == '1' || c == 'X').collect();
648+
/// let v: Vec<&str> = "abc1def2ghi".split(|c: char| c.is_numeric()).collect();
655649
/// assert_eq!(v, ["abc", "def", "ghi"]);
650+
///
651+
/// let v: Vec<&str> = "lionXtigerXleopard".split(char::is_uppercase).collect();
652+
/// assert_eq!(v, ["lion", "tiger", "leopard"]);
656653
/// ```
657654
#[stable(feature = "rust1", since = "1.0.0")]
658655
pub fn split<'a, P: Pattern<'a>>(&'a self, pat: P) -> Split<'a, P> {
@@ -694,11 +691,14 @@ impl str {
694691
/// assert_eq!(v, ["leopard", "tiger", "lion"]);
695692
/// ```
696693
///
697-
/// A more complex pattern, using a closure:
694+
/// More complex patterns with closures:
698695
///
699-
/// ```
700-
/// let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
696+
/// ```rust
697+
/// let v: Vec<&str> = "abc1def2ghi".rsplit(|c: char| c.is_numeric()).collect();
701698
/// assert_eq!(v, ["ghi", "def", "abc"]);
699+
///
700+
/// let v: Vec<&str> = "lionXtigerXleopard".rsplit(char::is_uppercase).collect();
701+
/// assert_eq!(v, ["leopard", "tiger", "lion"]);
702702
/// ```
703703
#[stable(feature = "rust1", since = "1.0.0")]
704704
pub fn rsplit<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplit<'a, P>
@@ -733,13 +733,22 @@ impl str {
733733
///
734734
/// # Examples
735735
///
736+
/// Simple patterns:
737+
///
736738
/// ```
737739
/// let v: Vec<&str> = "A.B.".split_terminator('.').collect();
738740
/// assert_eq!(v, ["A", "B"]);
739741
///
740742
/// let v: Vec<&str> = "A..B..".split_terminator(".").collect();
741743
/// assert_eq!(v, ["A", "", "B", ""]);
742744
/// ```
745+
///
746+
/// More complex patterns with closures:
747+
///
748+
/// ```
749+
/// let v: Vec<&str> = "abc1def2ghi3".split_terminator(|c: char| c.is_numeric()).collect();
750+
/// assert_eq!(v, ["abc", "def", "ghi"]);
751+
/// ```
743752
#[stable(feature = "rust1", since = "1.0.0")]
744753
pub fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator<'a, P> {
745754
core_str::StrExt::split_terminator(&self[..], pat)
@@ -769,13 +778,22 @@ impl str {
769778
///
770779
/// # Examples
771780
///
781+
/// Simple patterns:
782+
///
772783
/// ```
773784
/// let v: Vec<&str> = "A.B.".rsplit_terminator('.').collect();
774785
/// assert_eq!(v, ["B", "A"]);
775786
///
776787
/// let v: Vec<&str> = "A..B..".rsplit_terminator(".").collect();
777788
/// assert_eq!(v, ["", "B", "", "A"]);
778789
/// ```
790+
///
791+
/// More complex patterns with closures:
792+
///
793+
/// ```
794+
/// let v: Vec<&str> = "abc1def2ghi3".rsplit_terminator(|c: char| c.is_numeric()).collect();
795+
/// assert_eq!(v, ["ghi", "def", "abc"]);
796+
/// ```
779797
#[stable(feature = "rust1", since = "1.0.0")]
780798
pub fn rsplit_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplitTerminator<'a, P>
781799
where P::Searcher: ReverseSearcher<'a>
@@ -819,11 +837,11 @@ impl str {
819837
/// assert_eq!(v, [""]);
820838
/// ```
821839
///
822-
/// A more complex pattern, using a closure:
840+
/// More complex patterns with closures:
823841
///
824842
/// ```
825-
/// let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
826-
/// assert_eq!(v, ["abc", "defXghi"]);
843+
/// let v: Vec<&str> = "abc1def2ghi".splitn(2, |c: char| c.is_numeric()).collect();
844+
/// assert_eq!(v, ["abc", "def2ghi"]);
827845
/// ```
828846
#[stable(feature = "rust1", since = "1.0.0")]
829847
pub fn splitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> SplitN<'a, P> {
@@ -864,10 +882,10 @@ impl str {
864882
/// assert_eq!(v, ["leopard", "lion::tiger"]);
865883
/// ```
866884
///
867-
/// A more complex pattern, using a closure:
885+
/// More complex patterns with closures:
868886
///
869887
/// ```
870-
/// let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
888+
/// let v: Vec<&str> = "abc1def2ghi".rsplitn(2, |c: char| c.is_numeric()).collect();
871889
/// assert_eq!(v, ["ghi", "abc1def"]);
872890
/// ```
873891
#[stable(feature = "rust1", since = "1.0.0")]
@@ -902,7 +920,7 @@ impl str {
902920
/// let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
903921
/// assert_eq!(v, ["abc", "abc", "abc"]);
904922
///
905-
/// let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect();
923+
/// let v: Vec<&str> = "1abc2abc3".matches(|c: char| c.is_numeric()).collect();
906924
/// assert_eq!(v, ["1", "2", "3"]);
907925
/// ```
908926
#[unstable(feature = "collections",
@@ -935,7 +953,7 @@ impl str {
935953
/// let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
936954
/// assert_eq!(v, ["abc", "abc", "abc"]);
937955
///
938-
/// let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect();
956+
/// let v: Vec<&str> = "1abc2abc3".rmatches(|c: char| c.is_numeric()).collect();
939957
/// assert_eq!(v, ["3", "2", "1"]);
940958
/// ```
941959
#[unstable(feature = "collections",
@@ -1181,16 +1199,15 @@ impl str {
11811199
///
11821200
/// ```
11831201
/// assert_eq!("11foo1bar11".trim_matches('1'), "foo1bar");
1184-
/// assert_eq!("123foo1bar123".trim_matches(char::is_numeric), "foo1bar");
11851202
///
11861203
/// let x: &[_] = &['1', '2'];
11871204
/// assert_eq!("12foo1bar12".trim_matches(x), "foo1bar");
11881205
/// ```
11891206
///
1190-
/// A more complex pattern, using a closure:
1207+
/// More complex patterns with closures:
11911208
///
11921209
/// ```
1193-
/// assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
1210+
/// assert_eq!("123foo1bar123".trim_matches(|c: char| c.is_numeric()), "foo1bar");
11941211
/// ```
11951212
#[stable(feature = "rust1", since = "1.0.0")]
11961213
pub fn trim_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
@@ -1207,13 +1224,20 @@ impl str {
12071224
///
12081225
/// # Examples
12091226
///
1227+
/// Simple patterns:
1228+
///
12101229
/// ```
12111230
/// assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
1212-
/// assert_eq!("123foo1bar123".trim_left_matches(char::is_numeric), "foo1bar123");
12131231
///
12141232
/// let x: &[_] = &['1', '2'];
12151233
/// assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
12161234
/// ```
1235+
///
1236+
/// More complex patterns with closures:
1237+
///
1238+
/// ```
1239+
/// assert_eq!("123foo1bar123".trim_left_matches(|c: char| c.is_numeric()), "foo1bar123");
1240+
/// ```
12171241
#[stable(feature = "rust1", since = "1.0.0")]
12181242
pub fn trim_left_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str {
12191243
core_str::StrExt::trim_left_matches(&self[..], pat)
@@ -1231,16 +1255,14 @@ impl str {
12311255
///
12321256
/// ```
12331257
/// assert_eq!("11foo1bar11".trim_right_matches('1'), "11foo1bar");
1234-
/// assert_eq!("123foo1bar123".trim_right_matches(char::is_numeric), "123foo1bar");
1235-
///
12361258
/// let x: &[_] = &['1', '2'];
12371259
/// assert_eq!("12foo1bar12".trim_right_matches(x), "12foo1bar");
12381260
/// ```
12391261
///
1240-
/// A more complex pattern, using a closure:
1262+
/// More complex patterns with closures:
12411263
///
12421264
/// ```
1243-
/// assert_eq!("1fooX".trim_left_matches(|c| c == '1' || c == 'X'), "fooX");
1265+
/// assert_eq!("123foo1bar123".trim_right_matches(|c: char| c.is_numeric()), "123foo1bar");
12441266
/// ```
12451267
#[stable(feature = "rust1", since = "1.0.0")]
12461268
pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
@@ -1477,7 +1499,7 @@ impl str {
14771499
/// ```
14781500
/// let s = "Löwe 老虎 Léopard";
14791501
///
1480-
/// assert_eq!(s.find(char::is_whitespace), Some(5));
1502+
/// assert_eq!(s.find(|c: char| c.is_whitespace()), Some(5));
14811503
/// assert_eq!(s.find(char::is_lowercase), Some(1));
14821504
/// ```
14831505
///
@@ -1519,7 +1541,7 @@ impl str {
15191541
/// ```
15201542
/// let s = "Löwe 老虎 Léopard";
15211543
///
1522-
/// assert_eq!(s.rfind(char::is_whitespace), Some(12));
1544+
/// assert_eq!(s.rfind(|c: char| c.is_whitespace()), Some(12));
15231545
/// assert_eq!(s.rfind(char::is_lowercase), Some(20));
15241546
/// ```
15251547
///

branches/tmp/src/libcollections/string.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ impl String {
9393
/// assert_eq!(&s[..], "hello");
9494
/// ```
9595
#[inline]
96-
#[unstable(feature = "collections",
97-
reason = "needs investigation to see if to_string() can match perf")]
96+
#[unstable(feature = "collections", reason = "use `String::from` instead")]
97+
#[deprecated(since = "1.2.0", reason = "use `String::from` instead")]
9898
#[cfg(not(test))]
9999
pub fn from_str(string: &str) -> String {
100100
String { vec: <[_]>::to_vec(string.as_bytes()) }
@@ -793,13 +793,6 @@ impl Extend<char> for String {
793793
}
794794
}
795795

796-
#[stable(feature = "extend_ref", since = "1.2.0")]
797-
impl<'a> Extend<&'a char> for String {
798-
fn extend<I: IntoIterator<Item=&'a char>>(&mut self, iter: I) {
799-
self.extend(iter.into_iter().cloned());
800-
}
801-
}
802-
803796
#[stable(feature = "rust1", since = "1.0.0")]
804797
impl<'a> Extend<&'a str> for String {
805798
fn extend<I: IntoIterator<Item=&'a str>>(&mut self, iterable: I) {

branches/tmp/src/libcollections/vec.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ use borrow::{Cow, IntoCow};
8383
use super::range::RangeArgument;
8484

8585
// FIXME- fix places which assume the max vector allowed has memory usize::MAX.
86-
const MAX_MEMORY_SIZE: usize = isize::MAX as usize;
86+
static MAX_MEMORY_SIZE: usize = isize::MAX as usize;
8787

8888
/// A growable list type, written `Vec<T>` but pronounced 'vector.'
8989
///
@@ -1578,13 +1578,6 @@ impl<T> Extend<T> for Vec<T> {
15781578
}
15791579
}
15801580

1581-
#[stable(feature = "extend_ref", since = "1.2.0")]
1582-
impl<'a, T: 'a + Copy> Extend<&'a T> for Vec<T> {
1583-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
1584-
self.extend(iter.into_iter().cloned());
1585-
}
1586-
}
1587-
15881581
__impl_slice_eq1! { Vec<A>, Vec<B> }
15891582
__impl_slice_eq1! { Vec<A>, &'b [B] }
15901583
__impl_slice_eq1! { Vec<A>, &'b mut [B] }

0 commit comments

Comments
 (0)