Move RangeArguments to {core::std}::ops and rename to RangeBounds

These unstable items are deprecated:

* The `std::collections::range::RangeArgument` reexport
* The `std::collections::range` module.
This commit is contained in:
Simon Sapin
2018-03-19 09:26:29 +01:00
committed by Manish Goregaokar
parent c3a63970de
commit 16d3ba1b23
13 changed files with 183 additions and 184 deletions

View File

@@ -76,7 +76,7 @@ use core::mem;
#[cfg(not(test))]
use core::num::Float;
use core::ops::Bound::{Excluded, Included, Unbounded};
use core::ops::{InPlace, Index, IndexMut, Place, Placer};
use core::ops::{InPlace, Index, IndexMut, Place, Placer, RangeBounds};
use core::ops;
use core::ptr;
use core::ptr::NonNull;
@@ -86,7 +86,6 @@ use borrow::ToOwned;
use borrow::Cow;
use boxed::Box;
use raw_vec::RawVec;
use super::range::RangeArgument;
use super::allocator::CollectionAllocErr;
/// A contiguous growable array type, written `Vec<T>` but pronounced 'vector'.
@@ -1176,7 +1175,7 @@ impl<T> Vec<T> {
/// ```
#[stable(feature = "drain", since = "1.6.0")]
pub fn drain<R>(&mut self, range: R) -> Drain<T>
where R: RangeArgument<usize>
where R: RangeBounds<usize>
{
// Memory safety
//
@@ -1950,7 +1949,7 @@ impl<T> Vec<T> {
#[inline]
#[stable(feature = "vec_splice", since = "1.21.0")]
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
where R: RangeArgument<usize>, I: IntoIterator<Item=T>
where R: RangeBounds<usize>, I: IntoIterator<Item=T>
{
Splice {
drain: self.drain(range),