Trait Solver 5 @BoxyUwU @WaffleLapkin
Warning: this quiz is still "work-in-progress", some questions might not have good explanations (or any at all), formatting/structure/titles/etc are not final, and so on. You might want to return here on a later date.
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() {}
Solution
error[E0119]: conflicting implementations of trait `Overlap<_>` for type `()`
--> examples/trait_solver_5.rs:6:1
|
5 | impl<T, U: Sub<T>> Overlap<T> for U {}
| ----------------------------------- first implementation here
6 | impl<T> Overlap<T> for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
|
= note: downstream crates may implement trait `Sub<_>` for type `()`
For more information about this error, try `rustc --explain E0119`.
error: could not compile `code` (example "trait_solver_5") due to 1 previous error