diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 185913a47f1a2..8e7c3296f9584 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -426,9 +426,12 @@ impl [T] { /// refers to an element of this slice: /// /// ``` - /// let a = [1,2,3]; + /// #![feature(slice_ptr_range)] + /// + /// let a = [1, 2, 3]; /// let x = &a[1]; /// let y = &5; + /// /// assert!(a.as_ptr_range().contains(x)); /// assert!(!a.as_ptr_range().contains(y)); /// ```