Expand description

The coinductive_overlap_in_coherence lint detects impls which are currently considered not overlapping, but may be considered to overlap if support for coinduction is added to the trait solver.



trait CyclicTrait {}
impl<T: CyclicTrait> CyclicTrait for T {}

trait Trait {}
impl<T: CyclicTrait> Trait for T {}
// conflicting impl with the above
impl Trait for u8 {}



We have two choices for impl which satisfy u8: Trait: the blanket impl for generic T, and the direct impl for u8. These two impls nominally overlap, since we can infer T = u8 in the former impl, but since the where clause u8: CyclicTrait would end up resulting in a cycle (since it depends on itself), the blanket impl is not considered to hold for u8. This will change in a future release.