1 // These are all the possible variations of this error I could think of for.
2 // `trait-with-missing-associated-type-restriction-fixable.rs` contains the subset of these that
3 // can be fixed with `rustfix`.
5 trait Trait<T = Self> {
8 fn func(&self) -> Self::A;
9 fn funk(&self, _: Self::A);
10 fn funq(&self) -> Self::A {} //~ ERROR mismatched types
13 fn foo(_: impl Trait, x: impl Trait) {
14 qux(x.func()) //~ ERROR mismatched types
17 fn bar<T: Trait>(x: T) {
18 qux(x.func()) //~ ERROR mismatched types
21 fn foo2(x: impl Trait<i32>) {
22 qux(x.func()) //~ ERROR mismatched types
25 fn bar2<T: Trait<i32>>(x: T) {
26 x.funk(3); //~ ERROR mismatched types
27 qux(x.func()) //~ ERROR mismatched types
30 fn baz<D: std::fmt::Debug, T: Trait<A = D>>(x: T) {
31 qux(x.func()) //~ ERROR mismatched types
34 fn bat(x: &mut dyn Trait<(), A = ()>) {
35 qux(x.func()) //~ ERROR mismatched types
38 fn ban<T>(x: T) where T: Trait {
39 qux(x.func()) //~ ERROR mismatched types