about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/arc.rs3
-rw-r--r--src/libcollections/string.rs2
-rw-r--r--src/libcollections/vec.rs2
-rw-r--r--src/libcore/intrinsics.rs2
-rw-r--r--src/libcore/iter.rs13
-rw-r--r--src/libcore/macros.rs5
-rw-r--r--src/libcore/option.rs3
7 files changed, 6 insertions, 24 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index d12d28335dd..990a73c53ae 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -98,7 +98,6 @@ use heap::deallocate;
 /// increase the reference counter.
 ///
 /// ```
-/// # #![feature(alloc, core)]
 /// use std::sync::Arc;
 /// use std::thread;
 ///
@@ -297,7 +296,6 @@ impl<T: ?Sized> Clone for Arc<T> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let five = Arc::new(5);
@@ -392,7 +390,6 @@ impl<T: ?Sized> Drop for Arc<T> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// {
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index c328a58f077..7edcf3d3c9a 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -88,7 +88,7 @@ impl String {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(collections, core)]
+    /// # #![feature(collections)]
     /// let s = String::from_str("hello");
     /// assert_eq!(&s[..], "hello");
     /// ```
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 8dacfa53bc9..818943667d3 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -840,7 +840,7 @@ impl<T> Vec<T> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(collections, core)]
+    /// # #![feature(collections)]
     /// let v = vec![0, 1, 2];
     /// let w = v.map_in_place(|i| i + 3);
     /// assert_eq!(&w[..], &[3, 4, 5]);
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index 88a686ec255..16094f2e6cc 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -308,7 +308,6 @@ extern "rust-intrinsic" {
     /// A safe swap function:
     ///
     /// ```
-    /// # #![feature(core)]
     /// use std::mem;
     /// use std::ptr;
     ///
@@ -348,7 +347,6 @@ extern "rust-intrinsic" {
     /// Efficiently create a Rust vector from an unsafe buffer:
     ///
     /// ```
-    /// # #![feature(core)]
     /// use std::ptr;
     ///
     /// unsafe fn from_buf_raw<T>(ptr: *const T, elts: usize) -> Vec<T> {
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 9337c501a3a..b12a1c1ed96 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -326,7 +326,6 @@ pub trait Iterator {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(core)]
     /// let xs = [100, 200, 300];
     /// let mut it = xs.iter().cloned().peekable();
     /// assert_eq!(*it.peek().unwrap(), 100);
@@ -514,15 +513,13 @@ pub trait Iterator {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(core)]
-    ///
     /// let a = [1, 4, 2, 3, 8, 9, 6];
     /// let sum: i32 = a.iter()
     ///                 .map(|x| *x)
     ///                 .inspect(|&x| println!("filtering {}", x))
     ///                 .filter(|&x| x % 2 == 0)
     ///                 .inspect(|&x| println!("{} made it through", x))
-    ///                 .sum();
+    ///                 .fold(0, |sum, i| sum + i);
     /// println!("{}", sum);
     /// ```
     #[inline]
@@ -572,7 +569,6 @@ pub trait Iterator {
     /// do not.
     ///
     /// ```
-    /// # #![feature(core)]
     /// let vec = vec![1, 2, 3, 4];
     /// let (even, odd): (Vec<_>, Vec<_>) = vec.into_iter().partition(|&n| n % 2 == 0);
     /// assert_eq!(even, [2, 4]);
@@ -897,7 +893,6 @@ pub trait Iterator {
     ///
     /// ```
     /// # #![feature(core)]
-    ///
     /// let a = [-3_i32, 0, 1, 5, -10];
     /// assert_eq!(*a.iter().max_by(|x| x.abs()).unwrap(), -10);
     /// ```
@@ -926,7 +921,6 @@ pub trait Iterator {
     ///
     /// ```
     /// # #![feature(core)]
-    ///
     /// let a = [-3_i32, 0, 1, 5, -10];
     /// assert_eq!(*a.iter().min_by(|x| x.abs()).unwrap(), 0);
     /// ```
@@ -971,7 +965,6 @@ pub trait Iterator {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(core)]
     /// let a = [(1, 2), (3, 4)];
     /// let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip();
     /// assert_eq!(left, [1, 3]);
@@ -1065,7 +1058,6 @@ pub trait Iterator {
     ///
     /// ```
     /// # #![feature(core)]
-    ///
     /// let a = [1, 2, 3, 4, 5];
     /// let it = a.iter();
     /// assert_eq!(it.sum::<i32>(), 15);
@@ -1084,7 +1076,6 @@ pub trait Iterator {
     ///
     /// ```
     /// # #![feature(core)]
-    ///
     /// fn factorial(n: u32) -> u32 {
     ///     (1..).take_while(|&i| i <= n).product()
     /// }
@@ -2730,7 +2721,7 @@ impl<A: Step> ops::Range<A> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(step_by, core)]
+    /// # #![feature(step_by)]
     /// for i in (0..10).step_by(2) {
     ///     println!("{}", i);
     /// }
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index 64eb75ea530..b5555fa5119 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -173,12 +173,11 @@ macro_rules! try {
 /// # Examples
 ///
 /// ```
-/// # #![allow(unused_must_use)]
 /// use std::io::Write;
 ///
 /// let mut w = Vec::new();
-/// write!(&mut w, "test");
-/// write!(&mut w, "formatted {}", "arguments");
+/// write!(&mut w, "test").unwrap();
+/// write!(&mut w, "formatted {}", "arguments").unwrap();
 /// ```
 #[macro_export]
 macro_rules! write {
diff --git a/src/libcore/option.rs b/src/libcore/option.rs
index 8d2d7252512..872186c09e2 100644
--- a/src/libcore/option.rs
+++ b/src/libcore/option.rs
@@ -474,7 +474,6 @@ impl<T> Option<T> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(core)]
     /// let x = Some("foo");
     /// assert_eq!(x.ok_or(0), Ok("foo"));
     ///
@@ -496,7 +495,6 @@ impl<T> Option<T> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(core)]
     /// let x = Some("foo");
     /// assert_eq!(x.ok_or_else(|| 0), Ok("foo"));
     ///
@@ -538,7 +536,6 @@ impl<T> Option<T> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(core)]
     /// let mut x = Some(4);
     /// match x.iter_mut().next() {
     ///     Some(&mut ref mut v) => *v = 42,