From eb63168e007058dad4af758faf1dca449c049777 Mon Sep 17 00:00:00 2001 From: dylni <46035563+dylni@users.noreply.github.com> Date: Fri, 18 Sep 2020 13:05:54 -0400 Subject: [PATCH] Fix doctests --- library/core/src/ops/range.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/core/src/ops/range.rs b/library/core/src/ops/range.rs index 378aad5cb9e9..d9420616b4bc 100644 --- a/library/core/src/ops/range.rs +++ b/library/core/src/ops/range.rs @@ -751,6 +751,8 @@ pub trait RangeBounds { /// ``` /// #![feature(range_bounds_for_length)] /// + /// use std::ops::RangeBounds; + /// /// let v = [10, 40, 30]; /// assert_eq!(1..2, (1..2).for_length(v.len())); /// assert_eq!(0..2, (..2).for_length(v.len())); @@ -762,18 +764,24 @@ pub trait RangeBounds { /// ```should_panic /// #![feature(range_bounds_for_length)] /// + /// use std::ops::RangeBounds; + /// /// (2..1).for_length(3); /// ``` /// /// ```should_panic /// #![feature(range_bounds_for_length)] /// + /// use std::ops::RangeBounds; + /// /// (1..4).for_length(3); /// ``` /// /// ```should_panic /// #![feature(range_bounds_for_length)] /// + /// use std::ops::RangeBounds; + /// /// (1..=usize::MAX).for_length(3); /// ``` ///