about summary refs log tree commit diff
path: root/src/libcore/ops
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-03-21 04:34:04 +0000
committerbors <bors@rust-lang.org>2020-03-21 04:34:04 +0000
commit5f13820478907b09d50baf74f3ff2b78499ecd6c (patch)
treef8a09a299d9c7e09f562913e7aadefd3c4f12f0e /src/libcore/ops
parent1057dc97afce39ff6a224966ece3ed438af4c1f5 (diff)
parent54285db640453d2beec91423cb8cc792f52797f2 (diff)
downloadrust-5f13820478907b09d50baf74f3ff2b78499ecd6c.tar.gz
rust-5f13820478907b09d50baf74f3ff2b78499ecd6c.zip
Auto merge of #70205 - Centril:rollup-0jq9k4s, r=Centril
Rollup of 16 pull requests

Successful merges:

 - #65097 (Make std::sync::Arc compatible with ThreadSanitizer)
 - #69033 (Use generator resume arguments in the async/await lowering)
 - #69997 (add `Option::{zip,zip_with}` methods under "option_zip" gate)
 - #70038 (Remove the call that makes miri fail)
 - #70058 (can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs.)
 - #70111 (BTreeMap: remove shared root)
 - #70139 (add delay_span_bug to TransmuteSizeDiff, just to be sure)
 - #70165 (Remove the erase regions MIR transform)
 - #70166 (Derive PartialEq, Eq and Hash for RangeInclusive)
 - #70176 (Add tests for #58319 and #65131)
 - #70177 (Fix oudated comment for NamedRegionMap)
 - #70184 (expand_include: set `.directory` to dir of included file.)
 - #70187 (more clippy fixes)
 - #70188 (Clean up E0439 explanation)
 - #70189 (Abi::is_signed: assert that we are a Scalar)
 - #70194 (#[must_use] on split_off())

Failed merges:

r? @ghost
Diffstat (limited to 'src/libcore/ops')
-rw-r--r--src/libcore/ops/range.rs24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/libcore/ops/range.rs b/src/libcore/ops/range.rs
index 8ffad82b69d..adee8cea442 100644
--- a/src/libcore/ops/range.rs
+++ b/src/libcore/ops/range.rs
@@ -1,5 +1,5 @@
 use crate::fmt;
-use crate::hash::{Hash, Hasher};
+use crate::hash::Hash;
 
 /// An unbounded range (`..`).
 ///
@@ -330,7 +330,7 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
 /// assert_eq!(arr[1..=3], [  1,2,3  ]);  // RangeInclusive
 /// ```
 #[doc(alias = "..=")]
-#[derive(Clone)] // not Copy -- see #27186
+#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
 #[stable(feature = "inclusive_range", since = "1.26.0")]
 pub struct RangeInclusive<Idx> {
     // Note that the fields here are not public to allow changing the
@@ -350,26 +350,6 @@ pub struct RangeInclusive<Idx> {
     pub(crate) exhausted: bool,
 }
 
-#[stable(feature = "inclusive_range", since = "1.26.0")]
-impl<Idx: PartialEq> PartialEq for RangeInclusive<Idx> {
-    #[inline]
-    fn eq(&self, other: &Self) -> bool {
-        self.start == other.start && self.end == other.end && self.exhausted == other.exhausted
-    }
-}
-
-#[stable(feature = "inclusive_range", since = "1.26.0")]
-impl<Idx: Eq> Eq for RangeInclusive<Idx> {}
-
-#[stable(feature = "inclusive_range", since = "1.26.0")]
-impl<Idx: Hash> Hash for RangeInclusive<Idx> {
-    fn hash<H: Hasher>(&self, state: &mut H) {
-        self.start.hash(state);
-        self.end.hash(state);
-        self.exhausted.hash(state);
-    }
-}
-
 impl<Idx> RangeInclusive<Idx> {
     /// Creates a new inclusive range. Equivalent to writing `start..=end`.
     ///