about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-29 11:34:17 +0000
committerbors <bors@rust-lang.org>2018-03-29 11:34:17 +0000
commitae544ee1c90afc0f939753014dc5e884cb2749a0 (patch)
treed07caa9ff970a3127f3530bc78460b81fe727ca7 /src/libstd
parent409744bcb91f4efa35b8fcc9e7033523a86b90c2 (diff)
parent6c9b3cccbcef8918829e173a2ea9c5d975cd2777 (diff)
Auto merge of #49163 - SimonSapin:range-bounds, r=alexcrichton
Rename RangeArgument to RangeBounds, move it and Bound to libcore

As proposed in the tracking issue: https://github.com/rust-lang/rust/issues/30877

Changes to *stable* items:

* `core::ops::Bound` / `std::ops::Bound` is new
* `std::collections::Bound` is a deprecated reexport of it (does this actually cause a warning?)

Changes to *unstable* items

* `alloc::Bound` is gone
* `alloc::range::RangeArgument` is moved to `core::ops::RangeBounds` / `std::ops::RangeBounds`
* `alloc::range` is gone
* `std::collections::range::RangeArgument` is deprecated reexport, to be removed later
* `std::collections::range` is deprecated, to be removed later
* `impl RangeBounds<T> for Range{,From,To,Inclusive,ToInclusive}<&T>` are added

The idea of replacing this trait with a type to be used with `Into<_>` is left for future consideration / work.

(Fixes https://github.com/rust-lang-nursery/rust-clippy/issues/2552.)
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/mod.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libstd/collections/mod.rs b/src/libstd/collections/mod.rs
index be88f4e268a..c7ad27d8d26 100644
--- a/src/libstd/collections/mod.rs
+++ b/src/libstd/collections/mod.rs
@@ -420,7 +420,9 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::Bound;
+#[rustc_deprecated(reason = "moved to `std::ops::Bound`", since = "1.26.0")]
+#[doc(hidden)]
+pub use ops::Bound;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use alloc::{BinaryHeap, BTreeMap, BTreeSet};
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -435,8 +437,13 @@ pub use self::hash_map::HashMap;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::hash_set::HashSet;
 
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::range;
+#[unstable(feature = "collections_range", issue = "30877")]
+#[rustc_deprecated(reason = "renamed and moved to `std::ops::RangeBounds`", since = "1.26.0")]
+#[doc(hidden)]
+/// Range syntax
+pub mod range {
+    pub use ops::RangeBounds as RangeArgument;
+}
 
 #[unstable(feature = "try_reserve", reason = "new API", issue="48043")]
 pub use alloc::allocator::CollectionAllocErr;