Skip to content

Commit

Permalink
Commenting out unsound specialiation.
Browse files Browse the repository at this point in the history
If perf results indicate that we need this, then we should try to
emulate it via a series of implementations on concrete types.
  • Loading branch information
pnkfelix committed Jan 16, 2020
1 parent 3291ae3 commit f2e1357
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/libcore/ops/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,15 @@ impl<T> RangeInclusiveEquality for T {
}
}

impl<T: PartialOrd> RangeInclusiveEquality for T {
#[inline]
fn canonicalized_is_empty(range: &RangeInclusive<Self>) -> bool {
range.is_empty()
}
}
// rust-lang/rust#67194: We cannot use this specialized implementation
// soundly in Rust today.
//
// impl<T: PartialOrd> RangeInclusiveEquality for T {
// #[inline]
// fn canonicalized_is_empty(range: &RangeInclusive<Self>) -> bool {
// range.is_empty()
// }
// }

#[stable(feature = "inclusive_range", since = "1.26.0")]
impl<Idx: PartialEq> PartialEq for RangeInclusive<Idx> {
Expand Down

0 comments on commit f2e1357

Please sign in to comment.