about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2015-03-13 15:28:35 -0700
committerBrian Anderson <banderson@mozilla.com>2015-03-23 14:40:26 -0700
commite9019101a82dd7f61dcdcd52bcc0123d5ed25d22 (patch)
tree6553b47da56745ce8cab9e17265bba143608aa97 /src/libcore
parentdf290f127e923e0aacfe8223dd77f0fa222f0bc8 (diff)
downloadrust-e9019101a82dd7f61dcdcd52bcc0123d5ed25d22.tar.gz
rust-e9019101a82dd7f61dcdcd52bcc0123d5ed25d22.zip
Add #![feature] attributes to doctests
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/cell.rs1
-rw-r--r--src/libcore/cmp.rs7
-rw-r--r--src/libcore/error.rs1
-rw-r--r--src/libcore/finally.rs2
-rw-r--r--src/libcore/fmt/mod.rs4
-rw-r--r--src/libcore/fmt/num.rs1
-rw-r--r--src/libcore/hash/mod.rs2
-rw-r--r--src/libcore/intrinsics.rs2
-rw-r--r--src/libcore/iter.rs22
-rw-r--r--src/libcore/lib.rs1
-rw-r--r--src/libcore/macros.rs1
-rw-r--r--src/libcore/marker.rs1
-rw-r--r--src/libcore/num/f32.rs3
-rw-r--r--src/libcore/num/f64.rs3
-rw-r--r--src/libcore/num/mod.rs22
-rw-r--r--src/libcore/option.rs4
-rw-r--r--src/libcore/ptr.rs2
-rw-r--r--src/libcore/raw.rs2
-rw-r--r--src/libcore/result.rs9
-rw-r--r--src/libcore/simd.rs2
-rw-r--r--src/libcore/slice.rs1
21 files changed, 87 insertions, 6 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index e3a7f23851c..a9c5de23d94 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -220,6 +220,7 @@ impl<T:Copy> Cell<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::cell::Cell;
     ///
     /// let c = Cell::new(5);
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
index b37bad5f754..9ab8ab8672d 100644
--- a/src/libcore/cmp.rs
+++ b/src/libcore/cmp.rs
@@ -19,7 +19,8 @@
 //! could do the following:
 //!
 //! ```
-//! use core::num::SignedInt;
+//! # #![feature(core)]
+//! use std::num::SignedInt;
 //!
 //! struct FuzzyNum {
 //!     num: i32,
@@ -398,6 +399,7 @@ pub fn max<T: Ord>(v1: T, v2: T) -> T {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::cmp;
 ///
 /// assert_eq!(Some(1), cmp::partial_min(1, 2));
@@ -407,6 +409,7 @@ pub fn max<T: Ord>(v1: T, v2: T) -> T {
 /// When comparison is impossible:
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::cmp;
 ///
 /// let result = cmp::partial_min(std::f64::NAN, 1.0);
@@ -429,6 +432,7 @@ pub fn partial_min<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::cmp;
 ///
 /// assert_eq!(Some(2), cmp::partial_max(1, 2));
@@ -438,6 +442,7 @@ pub fn partial_min<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
 /// When comparison is impossible:
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::cmp;
 ///
 /// let result = cmp::partial_max(std::f64::NAN, 1.0);
diff --git a/src/libcore/error.rs b/src/libcore/error.rs
index 161f6c78921..8baf9744bbc 100644
--- a/src/libcore/error.rs
+++ b/src/libcore/error.rs
@@ -48,6 +48,7 @@
 //! For example,
 //!
 //! ```
+//! # #![feature(os, old_io, old_path)]
 //! use std::error::FromError;
 //! use std::old_io::{File, IoError};
 //! use std::os::{MemoryMap, MapError};
diff --git a/src/libcore/finally.rs b/src/libcore/finally.rs
index 19cd34cdb09..93a7d2bb17b 100644
--- a/src/libcore/finally.rs
+++ b/src/libcore/finally.rs
@@ -19,6 +19,7 @@
 //! # Examples
 //!
 //! ```
+//! # #![feature(core)]
 //! # #![feature(unboxed_closures)]
 //!
 //! use std::finally::Finally;
@@ -70,6 +71,7 @@ impl<T, F> Finally<T> for F where F: FnMut() -> T {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::finally::try_finally;
 ///
 /// struct State<'a> { buffer: &'a mut [u8], len: usize }
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index 741cf7b47fa..cf427c16588 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -624,6 +624,7 @@ impl<'a> Formatter<'a> {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(debug_builders, core)]
     /// use std::fmt;
     ///
     /// struct Foo {
@@ -655,6 +656,7 @@ impl<'a> Formatter<'a> {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(debug_builders, core)]
     /// use std::fmt;
     ///
     /// struct Foo(i32, String);
@@ -683,6 +685,7 @@ impl<'a> Formatter<'a> {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(debug_builders, core)]
     /// use std::fmt;
     ///
     /// struct Foo(Vec<i32>);
@@ -712,6 +715,7 @@ impl<'a> Formatter<'a> {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(debug_builders, core)]
     /// use std::fmt;
     ///
     /// struct Foo(Vec<(String, i32)>);
diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs
index fe22ee60da6..49da99b97cb 100644
--- a/src/libcore/fmt/num.rs
+++ b/src/libcore/fmt/num.rs
@@ -146,6 +146,7 @@ pub struct RadixFmt<T, R>(T, R);
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::fmt::radix;
 /// assert_eq!(format!("{}", radix(55, 36)), "1j".to_string());
 /// ```
diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs
index fdc0020dfcd..3c5810fdf80 100644
--- a/src/libcore/hash/mod.rs
+++ b/src/libcore/hash/mod.rs
@@ -16,6 +16,7 @@
 //! # Examples
 //!
 //! ```rust
+//! # #![feature(hash)]
 //! use std::hash::{hash, Hash, SipHasher};
 //!
 //! #[derive(Hash)]
@@ -35,6 +36,7 @@
 //! the trait `Hash`:
 //!
 //! ```rust
+//! # #![feature(hash)]
 //! use std::hash::{hash, Hash, Hasher, SipHasher};
 //!
 //! struct Person {
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index 1462d07652d..9873ba476ac 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -262,6 +262,7 @@ extern "rust-intrinsic" {
     /// A safe swap function:
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::mem;
     /// use std::ptr;
     ///
@@ -301,6 +302,7 @@ 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: uint) -> Vec<T> {
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 4f8b1c21ab2..5f5b8ef73ef 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -334,6 +334,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let xs = [100, 200, 300];
     /// let mut it = xs.iter().cloned().peekable();
     /// assert_eq!(*it.peek().unwrap(), 100);
@@ -465,6 +466,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let xs = [2, 3];
     /// let ys = [0, 1, 0, 1, 2];
     /// let it = xs.iter().flat_map(|&x| std::iter::count(0, 1).take(x));
@@ -521,6 +523,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::AdditiveIterator;
     ///
     /// let a = [1, 4, 2, 3, 8, 9, 6];
@@ -563,6 +566,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 3, 4, 5];
     /// let b: Vec<_> = a.iter().cloned().collect();
     /// assert_eq!(a, b);
@@ -579,6 +583,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// 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]);
@@ -648,6 +653,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 3, 4, 5];
     /// let mut it = a.iter();
     /// assert!(it.any(|x| *x == 3));
@@ -668,6 +674,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 3, 4, 5];
     /// let mut it = a.iter();
     /// assert_eq!(it.find(|&x| *x == 3).unwrap(), &3);
@@ -690,6 +697,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 3, 4, 5];
     /// let mut it = a.iter();
     /// assert_eq!(it.position(|x| *x == 3).unwrap(), 2);
@@ -718,6 +726,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 2, 4, 5];
     /// let mut it = a.iter();
     /// assert_eq!(it.rposition(|x| *x == 2).unwrap(), 2);
@@ -795,6 +804,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::MinMaxResult::{NoElements, OneElement, MinMax};
     ///
     /// let a: [i32; 0] = [];
@@ -860,7 +870,8 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
-    /// use core::num::SignedInt;
+    /// # #![feature(core)]
+    /// use std::num::SignedInt;
     ///
     /// let a = [-3, 0, 1, 5, -10];
     /// assert_eq!(*a.iter().max_by(|x| x.abs()).unwrap(), -10);
@@ -890,7 +901,8 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
-    /// use core::num::SignedInt;
+    /// # #![feature(core)]
+    /// use std::num::SignedInt;
     ///
     /// let a = [-3, 0, 1, 5, -10];
     /// assert_eq!(*a.iter().min_by(|x| x.abs()).unwrap(), 0);
@@ -940,6 +952,7 @@ pub trait IteratorExt: Iterator + Sized {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [(1, 2), (3, 4)];
     /// let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip();
     /// assert_eq!([1, 3], left);
@@ -1146,6 +1159,7 @@ pub trait AdditiveIterator<A> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::AdditiveIterator;
     ///
     /// let a = [1, 2, 3, 4, 5];
@@ -1188,6 +1202,7 @@ pub trait MultiplicativeIterator<A> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::{count, MultiplicativeIterator};
     ///
     /// fn factorial(n: usize) -> usize {
@@ -1248,6 +1263,7 @@ impl<T: Clone> MinMaxResult<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::MinMaxResult::{self, NoElements, OneElement, MinMax};
     ///
     /// let r: MinMaxResult<i32> = NoElements;
@@ -2292,6 +2308,7 @@ impl<I: RandomAccessIterator, F> RandomAccessIterator for Inspect<I, F>
 /// An iterator that yields sequential Fibonacci numbers, and stops on overflow.
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::iter::Unfold;
 /// use std::num::Int; // For `.checked_add()`
 ///
@@ -2693,6 +2710,7 @@ pub struct RangeStepInclusive<A> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::iter::range_step_inclusive;
 ///
 /// for i in range_step_inclusive(0, 10, 2) {
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index 29cc11d5a60..6e82f0f854c 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -56,6 +56,7 @@
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/nightly/",
        html_playground_url = "http://play.rust-lang.org/")]
+#![doc(test(no_crate_inject))]
 
 #![feature(no_std)]
 #![no_std]
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index c647b037944..40e32f4171a 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -231,6 +231,7 @@ macro_rules! writeln {
 /// Iterators:
 ///
 /// ```
+/// # #![feature(core)]
 /// fn divide_by_three(x: u32) -> u32 { // one of the poorest implementations of x/3
 ///     for i in std::iter::count(0, 1) {
 ///         if 3*i < i { panic!("u32 overflow"); }
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index 1b866501b8e..ae6bcc79539 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -319,6 +319,7 @@ impl<T:?Sized> MarkerTrait for T { }
 /// `MarkerTrait`:
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::marker::MarkerTrait;
 /// trait Even : MarkerTrait { }
 /// ```
diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs
index ae1b5f65eeb..d211b0f9928 100644
--- a/src/libcore/num/f32.rs
+++ b/src/libcore/num/f32.rs
@@ -282,7 +282,8 @@ impl Float for f32 {
     /// The fractional part of the number, satisfying:
     ///
     /// ```
-    /// use core::num::Float;
+    /// # #![feature(core)]
+    /// use std::num::Float;
     ///
     /// let x = 1.65f32;
     /// assert!(x == x.trunc() + x.fract())
diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs
index 4a73c1e8fcf..1421fdd72f2 100644
--- a/src/libcore/num/f64.rs
+++ b/src/libcore/num/f64.rs
@@ -289,7 +289,8 @@ impl Float for f64 {
     /// The fractional part of the number, satisfying:
     ///
     /// ```
-    /// use core::num::Float;
+    /// # #![feature(core)]
+    /// use std::num::Float;
     ///
     /// let x = 1.65f64;
     /// assert!(x == x.trunc() + x.fract())
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 17ef0ecb1c0..9ca7b48fbe5 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -85,6 +85,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0b01001100u8;
@@ -100,6 +101,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0b01001100u8;
@@ -119,6 +121,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0b0101000u16;
@@ -135,6 +138,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0b0101000u16;
@@ -151,6 +155,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0x0123456789ABCDEFu64;
@@ -168,6 +173,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0x0123456789ABCDEFu64;
@@ -392,6 +398,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// assert_eq!(2.pow(4), 16);
@@ -787,6 +794,7 @@ macro_rules! int_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b01001100u8;
@@ -803,6 +811,7 @@ macro_rules! int_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b01001100u8;
@@ -822,6 +831,7 @@ macro_rules! int_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b0101000u16;
@@ -841,6 +851,7 @@ macro_rules! int_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b0101000u16;
@@ -860,6 +871,7 @@ macro_rules! int_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0x0123456789ABCDEFu64;
@@ -881,6 +893,7 @@ macro_rules! int_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0x0123456789ABCDEFu64;
@@ -1112,6 +1125,7 @@ macro_rules! int_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// assert_eq!(2.pow(4), 16);
@@ -1277,6 +1291,7 @@ macro_rules! uint_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b01001100u8;
@@ -1295,6 +1310,7 @@ macro_rules! uint_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b01001100u8;
@@ -1314,6 +1330,7 @@ macro_rules! uint_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b0101000u16;
@@ -1333,6 +1350,7 @@ macro_rules! uint_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b0101000u16;
@@ -1352,6 +1370,7 @@ macro_rules! uint_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0x0123456789ABCDEFu64;
@@ -1375,6 +1394,7 @@ macro_rules! uint_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0x0123456789ABCDEFu64;
@@ -1606,6 +1626,7 @@ macro_rules! uint_impl {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// assert_eq!(2.pow(4), 16);
@@ -2266,6 +2287,7 @@ impl_from_primitive! { f64, to_f64 }
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::num;
 ///
 /// let twenty: f32 = num::cast(0x14).unwrap();
diff --git a/src/libcore/option.rs b/src/libcore/option.rs
index 455c68d4319..ecb060397ab 100644
--- a/src/libcore/option.rs
+++ b/src/libcore/option.rs
@@ -275,6 +275,7 @@ impl<T> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let mut x = Some("Diamonds");
     /// {
     ///     let v = x.as_mut_slice();
@@ -470,6 +471,7 @@ impl<T> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let x = Some("foo");
     /// assert_eq!(x.ok_or(0), Ok("foo"));
     ///
@@ -491,6 +493,7 @@ impl<T> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let x = Some("foo");
     /// assert_eq!(x.ok_or_else(|| 0), Ok("foo"));
     ///
@@ -532,6 +535,7 @@ impl<T> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let mut x = Some(4);
     /// match x.iter_mut().next() {
     ///     Some(&mut ref mut v) => *v = 42,
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs
index 1cbea057e88..c05dffb3696 100644
--- a/src/libcore/ptr.rs
+++ b/src/libcore/ptr.rs
@@ -52,6 +52,7 @@
 //! the raw pointer. It doesn't destroy `T` or deallocate any memory.
 //!
 //! ```
+//! # #![feature(alloc)]
 //! use std::boxed;
 //!
 //! unsafe {
@@ -70,6 +71,7 @@
 //! ## 3. Get it from C.
 //!
 //! ```
+//! # #![feature(libc)]
 //! extern crate libc;
 //!
 //! use std::mem;
diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs
index 35dfc762687..8502a9c53c4 100644
--- a/src/libcore/raw.rs
+++ b/src/libcore/raw.rs
@@ -48,6 +48,7 @@ use mem;
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::raw::{self, Repr};
 ///
 /// let slice: &[u16] = &[1, 2, 3, 4];
@@ -106,6 +107,7 @@ pub struct Closure {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::mem;
 /// use std::raw;
 ///
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index bc8d53e2a57..a994590a395 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -95,6 +95,7 @@
 //! by the [`Writer`](../io/trait.Writer.html) trait:
 //!
 //! ```
+//! # #![feature(old_io)]
 //! use std::old_io::IoError;
 //!
 //! trait Writer {
@@ -110,6 +111,7 @@
 //! something like this:
 //!
 //! ```{.ignore}
+//! # #![feature(old_io)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
@@ -129,6 +131,7 @@
 //! a marginally useful message indicating why:
 //!
 //! ```{.no_run}
+//! # #![feature(old_io, old_path)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
@@ -140,6 +143,7 @@
 //! You might also simply assert success:
 //!
 //! ```{.no_run}
+//! # #![feature(old_io, old_path)]
 //! # use std::old_io::*;
 //! # use std::old_path::Path;
 //!
@@ -151,6 +155,7 @@
 //! Or propagate the error up the call stack with `try!`:
 //!
 //! ```
+//! # #![feature(old_io, old_path)]
 //! # use std::old_io::*;
 //! # use std::old_path::Path;
 //! fn write_message() -> Result<(), IoError> {
@@ -171,6 +176,7 @@
 //! It replaces this:
 //!
 //! ```
+//! # #![feature(old_io, old_path)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
@@ -196,6 +202,7 @@
 //! With this:
 //!
 //! ```
+//! # #![feature(old_io, old_path)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
@@ -411,6 +418,7 @@ impl<T, E> Result<T, E> {
     /// Convert from `Result<T, E>` to `&mut [T]` (without copying)
     ///
     /// ```
+    /// # #![feature(core)]
     /// let mut x: Result<&str, u32> = Ok("Gold");
     /// {
     ///     let v = x.as_mut_slice();
@@ -452,6 +460,7 @@ impl<T, E> Result<T, E> {
     /// ignoring I/O and parse errors:
     ///
     /// ```
+    /// # #![feature(old_io)]
     /// use std::old_io::*;
     ///
     /// let mut buffer: &[u8] = b"1\n2\n3\n4\n";
diff --git a/src/libcore/simd.rs b/src/libcore/simd.rs
index 0058971faf0..21cff3021ab 100644
--- a/src/libcore/simd.rs
+++ b/src/libcore/simd.rs
@@ -19,7 +19,7 @@
 //! provided beyond this module.
 //!
 //! ```rust
-//!
+//! # #![feature(core)]
 //! fn main() {
 //!     use std::simd::f32x4;
 //!     let a = f32x4(40.0, 41.0, 42.0, 43.0);
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs
index 907b2eba80c..b8e6a05f3da 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -1491,6 +1491,7 @@ pub unsafe fn from_raw_parts_mut<'a, T>(p: *mut T, len: usize) -> &'a mut [T] {
 /// # Examples
 ///
 /// ```
+/// #![feature(core)]
 /// use std::slice;
 ///
 /// // manifest a slice out of thin air!