rust/tests/ui/coherence/super-traits/super-trait-knowable-1.rs
2024-10-15 13:11:00 +02:00

16 lines
323 B
Rust

// Added in #124532. While `(): Super` is knowable, `(): Sub<?t>` is not.
//
// We therefore elaborate super trait bounds in the implicit negative
// overlap check.
//@ check-pass
trait Super {}
trait Sub<T>: Super {}
trait Overlap<T> {}
impl<T, U: Sub<T>> Overlap<T> for U {}
impl<T> Overlap<T> for () {}
fn main() {}