use std::borrow::Borrow; use std::cmp::Ordering; use std::marker::PhantomData; #[derive(PartialEq, Default)] //~^ ERROR conflicting implementations of trait `PartialEq>` for type `Interval<_>` 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 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() {}