Skip to content

Commit 225b245

Browse files
committed
Fix slice::as_ptr_range doctest.
1 parent de9b660 commit 225b245

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libcore/slice/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,12 @@ impl<T> [T] {
426426
/// refers to an element of this slice:
427427
///
428428
/// ```
429-
/// let a = [1,2,3];
429+
/// #![feature(slice_ptr_range)]
430+
///
431+
/// let a = [1, 2, 3];
430432
/// let x = &a[1];
431433
/// let y = &5;
434+
///
432435
/// assert!(a.as_ptr_range().contains(x));
433436
/// assert!(!a.as_ptr_range().contains(y));
434437
/// ```

0 commit comments

Comments
 (0)