Skip to content

Commit d07e094

Browse files
committed
---
yaml --- r: 212287 b: refs/heads/auto c: 93d01eb h: refs/heads/master i: 212285: b09ba2a 212283: f2dacac 212279: 6f33cb1 212271: 311dc16 212255: 9b90a9a 212223: 987c9a9 v: v3
1 parent 2cddf22 commit d07e094

File tree

14 files changed

+110
-50
lines changed

14 files changed

+110
-50
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 8f9f2fe97e78bd7dbdfc477b765d5e6dc930b9eb
13+
refs/heads/auto: 93d01eb443d0f871716c9d7faa3b69dc49662663
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/liballoc/arc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ use heap::deallocate;
9898
/// increase the reference counter.
9999
///
100100
/// ```
101+
/// # #![feature(alloc, core)]
101102
/// use std::sync::Arc;
102103
/// use std::thread;
103104
///
@@ -296,6 +297,7 @@ impl<T: ?Sized> Clone for Arc<T> {
296297
/// # Examples
297298
///
298299
/// ```
300+
/// # #![feature(alloc)]
299301
/// use std::sync::Arc;
300302
///
301303
/// let five = Arc::new(5);
@@ -390,6 +392,7 @@ impl<T: ?Sized> Drop for Arc<T> {
390392
/// # Examples
391393
///
392394
/// ```
395+
/// # #![feature(alloc)]
393396
/// use std::sync::Arc;
394397
///
395398
/// {

branches/auto/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/auto/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)]
91+
/// # #![feature(collections, core)]
9292
/// let s = String::from_str("hello");
9393
/// assert_eq!(&s[..], "hello");
9494
/// ```

branches/auto/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)]
843+
/// # #![feature(collections, core)]
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/auto/src/libcore/intrinsics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ extern "rust-intrinsic" {
308308
/// A safe swap function:
309309
///
310310
/// ```
311+
/// # #![feature(core)]
311312
/// use std::mem;
312313
/// use std::ptr;
313314
///
@@ -347,6 +348,7 @@ extern "rust-intrinsic" {
347348
/// Efficiently create a Rust vector from an unsafe buffer:
348349
///
349350
/// ```
351+
/// # #![feature(core)]
350352
/// use std::ptr;
351353
///
352354
/// unsafe fn from_buf_raw<T>(ptr: *const T, elts: usize) -> Vec<T> {

branches/auto/src/libcore/iter.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ pub trait Iterator {
326326
/// # Examples
327327
///
328328
/// ```
329+
/// # #![feature(core)]
329330
/// let xs = [100, 200, 300];
330331
/// let mut it = xs.iter().cloned().peekable();
331332
/// assert_eq!(*it.peek().unwrap(), 100);
@@ -513,13 +514,15 @@ pub trait Iterator {
513514
/// # Examples
514515
///
515516
/// ```
517+
/// # #![feature(core)]
518+
///
516519
/// let a = [1, 4, 2, 3, 8, 9, 6];
517520
/// let sum: i32 = a.iter()
518521
/// .map(|x| *x)
519522
/// .inspect(|&x| println!("filtering {}", x))
520523
/// .filter(|&x| x % 2 == 0)
521524
/// .inspect(|&x| println!("{} made it through", x))
522-
/// .fold(0, |sum, i| sum + i);
525+
/// .sum();
523526
/// println!("{}", sum);
524527
/// ```
525528
#[inline]
@@ -569,6 +572,7 @@ pub trait Iterator {
569572
/// do not.
570573
///
571574
/// ```
575+
/// # #![feature(core)]
572576
/// let vec = vec![1, 2, 3, 4];
573577
/// let (even, odd): (Vec<_>, Vec<_>) = vec.into_iter().partition(|&n| n % 2 == 0);
574578
/// assert_eq!(even, [2, 4]);
@@ -893,6 +897,7 @@ pub trait Iterator {
893897
///
894898
/// ```
895899
/// # #![feature(core)]
900+
///
896901
/// let a = [-3_i32, 0, 1, 5, -10];
897902
/// assert_eq!(*a.iter().max_by(|x| x.abs()).unwrap(), -10);
898903
/// ```
@@ -921,6 +926,7 @@ pub trait Iterator {
921926
///
922927
/// ```
923928
/// # #![feature(core)]
929+
///
924930
/// let a = [-3_i32, 0, 1, 5, -10];
925931
/// assert_eq!(*a.iter().min_by(|x| x.abs()).unwrap(), 0);
926932
/// ```
@@ -965,6 +971,7 @@ pub trait Iterator {
965971
/// # Examples
966972
///
967973
/// ```
974+
/// # #![feature(core)]
968975
/// let a = [(1, 2), (3, 4)];
969976
/// let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip();
970977
/// assert_eq!(left, [1, 3]);
@@ -1058,6 +1065,7 @@ pub trait Iterator {
10581065
///
10591066
/// ```
10601067
/// # #![feature(core)]
1068+
///
10611069
/// let a = [1, 2, 3, 4, 5];
10621070
/// let it = a.iter();
10631071
/// assert_eq!(it.sum::<i32>(), 15);
@@ -1076,6 +1084,7 @@ pub trait Iterator {
10761084
///
10771085
/// ```
10781086
/// # #![feature(core)]
1087+
///
10791088
/// fn factorial(n: u32) -> u32 {
10801089
/// (1..).take_while(|&i| i <= n).product()
10811090
/// }
@@ -2721,7 +2730,7 @@ impl<A: Step> ops::Range<A> {
27212730
/// # Examples
27222731
///
27232732
/// ```
2724-
/// # #![feature(step_by)]
2733+
/// # #![feature(step_by, core)]
27252734
/// for i in (0..10).step_by(2) {
27262735
/// println!("{}", i);
27272736
/// }

branches/auto/src/libcore/macros.rs

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

0 commit comments

Comments
 (0)