From 225b2453077faf6d02d72fb0b7b03ad57b5b390a Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Fri, 25 Oct 2019 17:22:03 +0200 Subject: [PATCH] Fix slice::as_ptr_range doctest. --- src/libcore/slice/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)); /// ```