diff --git a/src/libcore/ops/range.rs b/src/libcore/ops/range.rs index 210a0e118d5..97b476fa5b6 100644 --- a/src/libcore/ops/range.rs +++ b/src/libcore/ops/range.rs @@ -100,13 +100,13 @@ impl> Range { /// ``` /// #![feature(range_contains)] /// - /// assert!(!(3..5).contains(2)); - /// assert!( (3..5).contains(3)); - /// assert!( (3..5).contains(4)); - /// assert!(!(3..5).contains(5)); + /// assert!(!(3..5).contains(&2)); + /// assert!( (3..5).contains(&3)); + /// assert!( (3..5).contains(&4)); + /// assert!(!(3..5).contains(&5)); /// - /// assert!(!(3..3).contains(3)); - /// assert!(!(3..2).contains(3)); + /// assert!(!(3..3).contains(&3)); + /// assert!(!(3..2).contains(&3)); /// ``` #[unstable(feature = "range_contains", reason = "recently added as per RFC", issue = "32311")] pub fn contains(&self, item: &U) -> bool @@ -191,9 +191,9 @@ impl> RangeFrom { /// ``` /// #![feature(range_contains)] /// - /// assert!(!(3..).contains(2)); - /// assert!( (3..).contains(3)); - /// assert!( (3..).contains(1_000_000_000)); + /// assert!(!(3..).contains(&2)); + /// assert!( (3..).contains(&3)); + /// assert!( (3..).contains(&1_000_000_000)); /// ``` #[unstable(feature = "range_contains", reason = "recently added as per RFC", issue = "32311")] pub fn contains(&self, item: &U) -> bool @@ -266,9 +266,9 @@ impl> RangeTo { /// ``` /// #![feature(range_contains)] /// - /// assert!( (..5).contains(-1_000_000_000)); - /// assert!( (..5).contains(4)); - /// assert!(!(..5).contains(5)); + /// assert!( (..5).contains(&-1_000_000_000)); + /// assert!( (..5).contains(&4)); + /// assert!(!(..5).contains(&5)); /// ``` #[unstable(feature = "range_contains", reason = "recently added as per RFC", issue = "32311")] pub fn contains(&self, item: &U) -> bool @@ -330,14 +330,14 @@ impl> RangeInclusive { /// ``` /// #![feature(range_contains)] /// - /// assert!(!(3..=5).contains(2)); - /// assert!( (3..=5).contains(3)); - /// assert!( (3..=5).contains(4)); - /// assert!( (3..=5).contains(5)); - /// assert!(!(3..=5).contains(6)); + /// assert!(!(3..=5).contains(&2)); + /// assert!( (3..=5).contains(&3)); + /// assert!( (3..=5).contains(&4)); + /// assert!( (3..=5).contains(&5)); + /// assert!(!(3..=5).contains(&6)); /// - /// assert!( (3..=3).contains(3)); - /// assert!(!(3..=2).contains(3)); + /// assert!( (3..=3).contains(&3)); + /// assert!(!(3..=2).contains(&3)); /// ``` #[unstable(feature = "range_contains", reason = "recently added as per RFC", issue = "32311")] pub fn contains(&self, item: &U) -> bool @@ -447,9 +447,9 @@ impl> RangeToInclusive { /// ``` /// #![feature(range_contains)] /// - /// assert!( (..=5).contains(-1_000_000_000)); - /// assert!( (..=5).contains(5)); - /// assert!(!(..=5).contains(6)); + /// assert!( (..=5).contains(&-1_000_000_000)); + /// assert!( (..=5).contains(&5)); + /// assert!(!(..=5).contains(&6)); /// ``` #[unstable(feature = "range_contains", reason = "recently added as per RFC", issue = "32311")] pub fn contains(&self, item: &U) -> bool