1 error[E0308]: mismatched types
2 --> $DIR/trait-with-missing-associated-type-restriction.rs:10:31
4 LL | fn funq(&self) -> Self::A {}
5 | ^^ expected associated type, found `()`
7 = note: expected associated type `<Self as Trait<T>>::A`
9 help: a method is available that returns `<Self as Trait<T>>::A`
10 --> $DIR/trait-with-missing-associated-type-restriction.rs:8:5
12 LL | fn func(&self) -> Self::A;
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ consider calling `Trait::func`
15 error[E0308]: mismatched types
16 --> $DIR/trait-with-missing-associated-type-restriction.rs:14:9
19 | ^^^^^^^^ expected `usize`, found associated type
21 = note: expected type `usize`
22 found associated type `<impl Trait as Trait>::A`
23 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
25 LL | fn foo(_: impl Trait, x: impl Trait<A = usize>) {
28 error[E0308]: mismatched types
29 --> $DIR/trait-with-missing-associated-type-restriction.rs:18:9
32 | ^^^^^^^^ expected `usize`, found associated type
34 = note: expected type `usize`
35 found associated type `<T as Trait>::A`
36 help: consider constraining the associated type `<T as Trait>::A` to `usize`
38 LL | fn bar<T: Trait<A = usize>>(x: T) {
41 error[E0308]: mismatched types
42 --> $DIR/trait-with-missing-associated-type-restriction.rs:22:9
45 | ^^^^^^^^ expected `usize`, found associated type
47 = note: expected type `usize`
48 found associated type `<impl Trait<i32> as Trait<i32>>::A`
49 help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
51 LL | fn foo2(x: impl Trait<i32, A = usize>) {
54 error[E0308]: mismatched types
55 --> $DIR/trait-with-missing-associated-type-restriction.rs:26:12
58 | ^ expected associated type, found integer
60 = note: expected associated type `<T as Trait<i32>>::A`
61 found type `{integer}`
62 help: some methods are available that return `<T as Trait<i32>>::A`
63 --> $DIR/trait-with-missing-associated-type-restriction.rs:8:5
65 LL | fn func(&self) -> Self::A;
66 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ consider calling `Trait::func`
67 LL | fn funk(&self, _: Self::A);
68 LL | fn funq(&self) -> Self::A {}
69 | ^^^^^^^^^^^^^^^^^^^^^^^^^ consider calling `Trait::funq`
70 help: consider constraining the associated type `<T as Trait<i32>>::A` to `{integer}`
72 LL | fn bar2<T: Trait<i32, A = {integer}>>(x: T) {
75 error[E0308]: mismatched types
76 --> $DIR/trait-with-missing-associated-type-restriction.rs:27:9
79 | ^^^^^^^^ expected `usize`, found associated type
81 = note: expected type `usize`
82 found associated type `<T as Trait<i32>>::A`
83 help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
85 LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
88 error[E0308]: mismatched types
89 --> $DIR/trait-with-missing-associated-type-restriction.rs:31:9
91 LL | fn baz<D: std::fmt::Debug, T: Trait<A = D>>(x: T) {
92 | - this type parameter
94 | ^^^^^^^^ expected `usize`, found type parameter `D`
96 = note: expected type `usize`
97 found type parameter `D`
99 error[E0308]: mismatched types
100 --> $DIR/trait-with-missing-associated-type-restriction.rs:35:9
103 | ^^^^^^^^ expected `usize`, found `()`
105 error[E0308]: mismatched types
106 --> $DIR/trait-with-missing-associated-type-restriction.rs:39:9
109 | ^^^^^^^^ expected `usize`, found associated type
111 = note: expected type `usize`
112 found associated type `<T as Trait>::A`
113 help: consider constraining the associated type `<T as Trait>::A` to `usize`
115 LL | fn ban<T>(x: T) where T: Trait<A = usize> {
118 error: aborting due to 9 previous errors
120 For more information about this error, try `rustc --explain E0308`.