mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Fix doctests
This commit is contained in:
parent
1095dcab96
commit
eb63168e00
@ -751,6 +751,8 @@ pub trait RangeBounds<T: ?Sized> {
|
||||
/// ```
|
||||
/// #![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<T: ?Sized> {
|
||||
/// ```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);
|
||||
/// ```
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user