Skip to content

Commit 028223a

Browse files
committed
---
yaml --- r: 212312 b: refs/heads/tmp c: dcc59c0 h: refs/heads/master v: v3
1 parent b68f2c8 commit 028223a

File tree

10 files changed

+36
-75
lines changed

10 files changed

+36
-75
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: 62e70d35be3fe532c26a400b499c58a18f18dd3a
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: 93d01eb443d0f871716c9d7faa3b69dc49662663
35+
refs/heads/tmp: dcc59c09a9efbaeb72a8de110804871dccac1854
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: 0b0c89efb37d1f7f6a72bf1a82a505cd1ca8b8eb
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/liballoc/arc.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ use heap::deallocate;
9898
/// increase the reference counter.
9999
///
100100
/// ```
101-
/// # #![feature(alloc, core)]
102101
/// use std::sync::Arc;
103102
/// use std::thread;
104103
///
@@ -297,7 +296,6 @@ impl<T: ?Sized> Clone for Arc<T> {
297296
/// # Examples
298297
///
299298
/// ```
300-
/// # #![feature(alloc)]
301299
/// use std::sync::Arc;
302300
///
303301
/// let five = Arc::new(5);
@@ -392,7 +390,6 @@ impl<T: ?Sized> Drop for Arc<T> {
392390
/// # Examples
393391
///
394392
/// ```
395-
/// # #![feature(alloc)]
396393
/// use std::sync::Arc;
397394
///
398395
/// {

branches/tmp/src/libcollections/str.rs

Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -640,17 +640,20 @@ impl str {
640640
///
641641
/// let v: Vec<&str> = "lion::tiger::leopard".split("::").collect();
642642
/// assert_eq!(v, ["lion", "tiger", "leopard"]);
643-
/// ```
644-
///
645-
/// More complex patterns with closures:
646643
///
647-
/// ```
648-
/// let v: Vec<&str> = "abc1def2ghi".split(|c: char| c.is_numeric()).collect();
644+
/// let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect();
649645
/// assert_eq!(v, ["abc", "def", "ghi"]);
650646
///
651647
/// let v: Vec<&str> = "lionXtigerXleopard".split(char::is_uppercase).collect();
652648
/// assert_eq!(v, ["lion", "tiger", "leopard"]);
653649
/// ```
650+
///
651+
/// A more complex pattern, using a closure:
652+
///
653+
/// ```
654+
/// let v: Vec<&str> = "abc1defXghi".split(|c| c == '1' || c == 'X').collect();
655+
/// assert_eq!(v, ["abc", "def", "ghi"]);
656+
/// ```
654657
#[stable(feature = "rust1", since = "1.0.0")]
655658
pub fn split<'a, P: Pattern<'a>>(&'a self, pat: P) -> Split<'a, P> {
656659
core_str::StrExt::split(&self[..], pat)
@@ -691,14 +694,11 @@ impl str {
691694
/// assert_eq!(v, ["leopard", "tiger", "lion"]);
692695
/// ```
693696
///
694-
/// More complex patterns with closures:
697+
/// A more complex pattern, using a closure:
695698
///
696-
/// ```rust
697-
/// let v: Vec<&str> = "abc1def2ghi".rsplit(|c: char| c.is_numeric()).collect();
699+
/// ```
700+
/// let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
698701
/// 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,22 +733,13 @@ impl str {
733733
///
734734
/// # Examples
735735
///
736-
/// Simple patterns:
737-
///
738736
/// ```
739737
/// let v: Vec<&str> = "A.B.".split_terminator('.').collect();
740738
/// assert_eq!(v, ["A", "B"]);
741739
///
742740
/// let v: Vec<&str> = "A..B..".split_terminator(".").collect();
743741
/// assert_eq!(v, ["A", "", "B", ""]);
744742
/// ```
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-
/// ```
752743
#[stable(feature = "rust1", since = "1.0.0")]
753744
pub fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator<'a, P> {
754745
core_str::StrExt::split_terminator(&self[..], pat)
@@ -778,22 +769,13 @@ impl str {
778769
///
779770
/// # Examples
780771
///
781-
/// Simple patterns:
782-
///
783772
/// ```
784773
/// let v: Vec<&str> = "A.B.".rsplit_terminator('.').collect();
785774
/// assert_eq!(v, ["B", "A"]);
786775
///
787776
/// let v: Vec<&str> = "A..B..".rsplit_terminator(".").collect();
788777
/// assert_eq!(v, ["", "B", "", "A"]);
789778
/// ```
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-
/// ```
797779
#[stable(feature = "rust1", since = "1.0.0")]
798780
pub fn rsplit_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplitTerminator<'a, P>
799781
where P::Searcher: ReverseSearcher<'a>
@@ -837,11 +819,11 @@ impl str {
837819
/// assert_eq!(v, [""]);
838820
/// ```
839821
///
840-
/// More complex patterns with closures:
822+
/// A more complex pattern, using a closure:
841823
///
842824
/// ```
843-
/// let v: Vec<&str> = "abc1def2ghi".splitn(2, |c: char| c.is_numeric()).collect();
844-
/// assert_eq!(v, ["abc", "def2ghi"]);
825+
/// let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
826+
/// assert_eq!(v, ["abc", "defXghi"]);
845827
/// ```
846828
#[stable(feature = "rust1", since = "1.0.0")]
847829
pub fn splitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> SplitN<'a, P> {
@@ -882,10 +864,10 @@ impl str {
882864
/// assert_eq!(v, ["leopard", "lion::tiger"]);
883865
/// ```
884866
///
885-
/// More complex patterns with closures:
867+
/// A more complex pattern, using a closure:
886868
///
887869
/// ```
888-
/// let v: Vec<&str> = "abc1def2ghi".rsplitn(2, |c: char| c.is_numeric()).collect();
870+
/// let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
889871
/// assert_eq!(v, ["ghi", "abc1def"]);
890872
/// ```
891873
#[stable(feature = "rust1", since = "1.0.0")]
@@ -920,7 +902,7 @@ impl str {
920902
/// let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
921903
/// assert_eq!(v, ["abc", "abc", "abc"]);
922904
///
923-
/// let v: Vec<&str> = "1abc2abc3".matches(|c: char| c.is_numeric()).collect();
905+
/// let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect();
924906
/// assert_eq!(v, ["1", "2", "3"]);
925907
/// ```
926908
#[unstable(feature = "collections",
@@ -953,7 +935,7 @@ impl str {
953935
/// let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
954936
/// assert_eq!(v, ["abc", "abc", "abc"]);
955937
///
956-
/// let v: Vec<&str> = "1abc2abc3".rmatches(|c: char| c.is_numeric()).collect();
938+
/// let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect();
957939
/// assert_eq!(v, ["3", "2", "1"]);
958940
/// ```
959941
#[unstable(feature = "collections",
@@ -1199,15 +1181,16 @@ impl str {
11991181
///
12001182
/// ```
12011183
/// assert_eq!("11foo1bar11".trim_matches('1'), "foo1bar");
1184+
/// assert_eq!("123foo1bar123".trim_matches(char::is_numeric), "foo1bar");
12021185
///
12031186
/// let x: &[_] = &['1', '2'];
12041187
/// assert_eq!("12foo1bar12".trim_matches(x), "foo1bar");
12051188
/// ```
12061189
///
1207-
/// More complex patterns with closures:
1190+
/// A more complex pattern, using a closure:
12081191
///
12091192
/// ```
1210-
/// assert_eq!("123foo1bar123".trim_matches(|c: char| c.is_numeric()), "foo1bar");
1193+
/// assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
12111194
/// ```
12121195
#[stable(feature = "rust1", since = "1.0.0")]
12131196
pub fn trim_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
@@ -1224,20 +1207,13 @@ impl str {
12241207
///
12251208
/// # Examples
12261209
///
1227-
/// Simple patterns:
1228-
///
12291210
/// ```
12301211
/// assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
1212+
/// assert_eq!("123foo1bar123".trim_left_matches(char::is_numeric), "foo1bar123");
12311213
///
12321214
/// let x: &[_] = &['1', '2'];
12331215
/// assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
12341216
/// ```
1235-
///
1236-
/// More complex patterns with closures:
1237-
///
1238-
/// ```
1239-
/// assert_eq!("123foo1bar123".trim_left_matches(|c: char| c.is_numeric()), "foo1bar123");
1240-
/// ```
12411217
#[stable(feature = "rust1", since = "1.0.0")]
12421218
pub fn trim_left_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str {
12431219
core_str::StrExt::trim_left_matches(&self[..], pat)
@@ -1255,14 +1231,16 @@ impl str {
12551231
///
12561232
/// ```
12571233
/// assert_eq!("11foo1bar11".trim_right_matches('1'), "11foo1bar");
1234+
/// assert_eq!("123foo1bar123".trim_right_matches(char::is_numeric), "123foo1bar");
1235+
///
12581236
/// let x: &[_] = &['1', '2'];
12591237
/// assert_eq!("12foo1bar12".trim_right_matches(x), "12foo1bar");
12601238
/// ```
12611239
///
1262-
/// More complex patterns with closures:
1240+
/// A more complex pattern, using a closure:
12631241
///
12641242
/// ```
1265-
/// assert_eq!("123foo1bar123".trim_right_matches(|c: char| c.is_numeric()), "123foo1bar");
1243+
/// assert_eq!("1fooX".trim_left_matches(|c| c == '1' || c == 'X'), "fooX");
12661244
/// ```
12671245
#[stable(feature = "rust1", since = "1.0.0")]
12681246
pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
@@ -1499,7 +1477,7 @@ impl str {
14991477
/// ```
15001478
/// let s = "Löwe 老虎 Léopard";
15011479
///
1502-
/// assert_eq!(s.find(|c: char| c.is_whitespace()), Some(5));
1480+
/// assert_eq!(s.find(char::is_whitespace), Some(5));
15031481
/// assert_eq!(s.find(char::is_lowercase), Some(1));
15041482
/// ```
15051483
///
@@ -1541,7 +1519,7 @@ impl str {
15411519
/// ```
15421520
/// let s = "Löwe 老虎 Léopard";
15431521
///
1544-
/// assert_eq!(s.rfind(|c: char| c.is_whitespace()), Some(12));
1522+
/// assert_eq!(s.rfind(char::is_whitespace), Some(12));
15451523
/// assert_eq!(s.rfind(char::is_lowercase), Some(20));
15461524
/// ```
15471525
///

branches/tmp/src/libcollections/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl String {
8888
/// # Examples
8989
///
9090
/// ```
91-
/// # #![feature(collections, core)]
91+
/// # #![feature(collections)]
9292
/// let s = String::from_str("hello");
9393
/// assert_eq!(&s[..], "hello");
9494
/// ```

branches/tmp/src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ impl<T> Vec<T> {
840840
/// # Examples
841841
///
842842
/// ```
843-
/// # #![feature(collections, core)]
843+
/// # #![feature(collections)]
844844
/// let v = vec![0, 1, 2];
845845
/// let w = v.map_in_place(|i| i + 3);
846846
/// assert_eq!(&w[..], &[3, 4, 5]);

branches/tmp/src/libcore/intrinsics.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ extern "rust-intrinsic" {
308308
/// A safe swap function:
309309
///
310310
/// ```
311-
/// # #![feature(core)]
312311
/// use std::mem;
313312
/// use std::ptr;
314313
///
@@ -348,7 +347,6 @@ extern "rust-intrinsic" {
348347
/// Efficiently create a Rust vector from an unsafe buffer:
349348
///
350349
/// ```
351-
/// # #![feature(core)]
352350
/// use std::ptr;
353351
///
354352
/// unsafe fn from_buf_raw<T>(ptr: *const T, elts: usize) -> Vec<T> {

branches/tmp/src/libcore/iter.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ pub trait Iterator {
326326
/// # Examples
327327
///
328328
/// ```
329-
/// # #![feature(core)]
330329
/// let xs = [100, 200, 300];
331330
/// let mut it = xs.iter().cloned().peekable();
332331
/// assert_eq!(*it.peek().unwrap(), 100);
@@ -514,15 +513,13 @@ pub trait Iterator {
514513
/// # Examples
515514
///
516515
/// ```
517-
/// # #![feature(core)]
518-
///
519516
/// let a = [1, 4, 2, 3, 8, 9, 6];
520517
/// let sum: i32 = a.iter()
521518
/// .map(|x| *x)
522519
/// .inspect(|&x| println!("filtering {}", x))
523520
/// .filter(|&x| x % 2 == 0)
524521
/// .inspect(|&x| println!("{} made it through", x))
525-
/// .sum();
522+
/// .fold(0, |sum, i| sum + i);
526523
/// println!("{}", sum);
527524
/// ```
528525
#[inline]
@@ -572,7 +569,6 @@ pub trait Iterator {
572569
/// do not.
573570
///
574571
/// ```
575-
/// # #![feature(core)]
576572
/// let vec = vec![1, 2, 3, 4];
577573
/// let (even, odd): (Vec<_>, Vec<_>) = vec.into_iter().partition(|&n| n % 2 == 0);
578574
/// assert_eq!(even, [2, 4]);
@@ -897,7 +893,6 @@ pub trait Iterator {
897893
///
898894
/// ```
899895
/// # #![feature(core)]
900-
///
901896
/// let a = [-3_i32, 0, 1, 5, -10];
902897
/// assert_eq!(*a.iter().max_by(|x| x.abs()).unwrap(), -10);
903898
/// ```
@@ -926,7 +921,6 @@ pub trait Iterator {
926921
///
927922
/// ```
928923
/// # #![feature(core)]
929-
///
930924
/// let a = [-3_i32, 0, 1, 5, -10];
931925
/// assert_eq!(*a.iter().min_by(|x| x.abs()).unwrap(), 0);
932926
/// ```
@@ -971,7 +965,6 @@ pub trait Iterator {
971965
/// # Examples
972966
///
973967
/// ```
974-
/// # #![feature(core)]
975968
/// let a = [(1, 2), (3, 4)];
976969
/// let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip();
977970
/// assert_eq!(left, [1, 3]);
@@ -1065,7 +1058,6 @@ pub trait Iterator {
10651058
///
10661059
/// ```
10671060
/// # #![feature(core)]
1068-
///
10691061
/// let a = [1, 2, 3, 4, 5];
10701062
/// let it = a.iter();
10711063
/// assert_eq!(it.sum::<i32>(), 15);
@@ -1084,7 +1076,6 @@ pub trait Iterator {
10841076
///
10851077
/// ```
10861078
/// # #![feature(core)]
1087-
///
10881079
/// fn factorial(n: u32) -> u32 {
10891080
/// (1..).take_while(|&i| i <= n).product()
10901081
/// }
@@ -2730,7 +2721,7 @@ impl<A: Step> ops::Range<A> {
27302721
/// # Examples
27312722
///
27322723
/// ```
2733-
/// # #![feature(step_by, core)]
2724+
/// # #![feature(step_by)]
27342725
/// for i in (0..10).step_by(2) {
27352726
/// println!("{}", i);
27362727
/// }

branches/tmp/src/libcore/macros.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,11 @@ macro_rules! try {
173173
/// # Examples
174174
///
175175
/// ```
176-
/// # #![allow(unused_must_use)]
177176
/// use std::io::Write;
178177
///
179178
/// let mut w = Vec::new();
180-
/// write!(&mut w, "test");
181-
/// write!(&mut w, "formatted {}", "arguments");
179+
/// write!(&mut w, "test").unwrap();
180+
/// write!(&mut w, "formatted {}", "arguments").unwrap();
182181
/// ```
183182
#[macro_export]
184183
macro_rules! write {

0 commit comments

Comments
 (0)