#![deny(coinductive_overlap_in_coherence)] use std::borrow::Borrow; use std::cmp::Ordering; use std::marker::PhantomData; #[derive(PartialEq, Default)] pub(crate) struct Interval(PhantomData); // This impl overlaps with the `derive` unless we reject the nested // `Interval: PartialOrd>` candidate which results // in a - currently inductive - cycle. impl PartialEq for Interval //~^ ERROR implementations of `PartialEq>` for `Interval<_>` will conflict in the future //~| WARN this was previously accepted by the compiler but is being phased out where T: Borrow, Q: ?Sized + PartialOrd, { fn eq(&self, _: &Q) -> bool { true } } impl PartialOrd for Interval where T: Borrow, Q: ?Sized + PartialOrd, { fn partial_cmp(&self, _: &Q) -> Option { None } } fn main() {}