]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr
Account for method call and indexing when looking for inner-most path in expression
[rust.git] / tests / ui / suggestions / trait-with-missing-associated-type-restriction-fixable.stderr
1 error[E0308]: mismatched types
2   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:13:13
3    |
4 LL |         qux(x.func())
5    |         --- ^^^^^^^^ expected `usize`, found associated type
6    |         |
7    |         arguments to this function are incorrect
8    |
9    = note:         expected type `usize`
10            found associated type `<impl Trait as Trait>::A`
11 note: function defined here
12   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
13    |
14 LL | fn qux(_: usize) {}
15    |    ^^^ --------
16 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
17    |
18 LL |     fn foo<'a, T: Trait + 'a>(&self, _: impl Trait, x: impl Trait<A = usize>, _: T) {
19    |                                                                  +++++++++++
20
21 error[E0308]: mismatched types
22   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:17:13
23    |
24 LL |         qux(x.func())
25    |         --- ^^^^^^^^ expected `usize`, found associated type
26    |         |
27    |         arguments to this function are incorrect
28    |
29    = note:         expected type `usize`
30            found associated type `<T as Trait>::A`
31 note: function defined here
32   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
33    |
34 LL | fn qux(_: usize) {}
35    |    ^^^ --------
36 help: consider constraining the associated type `<T as Trait>::A` to `usize`
37    |
38 LL |     fn ban<T>(x: T) where T: Trait<A = usize> {
39    |                                   +++++++++++
40
41 error[E0308]: mismatched types
42   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:22:9
43    |
44 LL |     qux(x.func())
45    |     --- ^^^^^^^^ expected `usize`, found associated type
46    |     |
47    |     arguments to this function are incorrect
48    |
49    = note:         expected type `usize`
50            found associated type `<impl Trait as Trait>::A`
51 note: function defined here
52   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
53    |
54 LL | fn qux(_: usize) {}
55    |    ^^^ --------
56 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
57    |
58 LL | fn foo<'a, T: Trait + 'a>(_: impl Trait, x: impl Trait<A = usize>, _: T) {
59    |                                                       +++++++++++
60
61 error[E0308]: mismatched types
62   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:26:9
63    |
64 LL |     qux(x.func())
65    |     --- ^^^^^^^^ expected `usize`, found associated type
66    |     |
67    |     arguments to this function are incorrect
68    |
69    = note:         expected type `usize`
70            found associated type `<T as Trait>::A`
71 note: function defined here
72   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
73    |
74 LL | fn qux(_: usize) {}
75    |    ^^^ --------
76 help: consider constraining the associated type `<T as Trait>::A` to `usize`
77    |
78 LL | fn bar<T: Trait<A = usize>>(x: T) {
79    |                +++++++++++
80
81 error[E0308]: mismatched types
82   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:30:9
83    |
84 LL |     qux(x.func())
85    |     --- ^^^^^^^^ expected `usize`, found associated type
86    |     |
87    |     arguments to this function are incorrect
88    |
89    = note:         expected type `usize`
90            found associated type `<impl Trait<i32> as Trait<i32>>::A`
91 note: function defined here
92   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
93    |
94 LL | fn qux(_: usize) {}
95    |    ^^^ --------
96 help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
97    |
98 LL | fn foo2(x: impl Trait<i32, A = usize>) {
99    |                          +++++++++++
100
101 error[E0308]: mismatched types
102   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:34:9
103    |
104 LL |     qux(x.func())
105    |     --- ^^^^^^^^ expected `usize`, found associated type
106    |     |
107    |     arguments to this function are incorrect
108    |
109    = note:         expected type `usize`
110            found associated type `<T as Trait<i32>>::A`
111 note: function defined here
112   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
113    |
114 LL | fn qux(_: usize) {}
115    |    ^^^ --------
116 help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
117    |
118 LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
119    |                     +++++++++++
120
121 error[E0308]: mismatched types
122   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:38:9
123    |
124 LL |     qux(x.func())
125    |     --- ^^^^^^^^ expected `usize`, found associated type
126    |     |
127    |     arguments to this function are incorrect
128    |
129    = note:         expected type `usize`
130            found associated type `<T as Trait>::A`
131 note: function defined here
132   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
133    |
134 LL | fn qux(_: usize) {}
135    |    ^^^ --------
136 help: consider constraining the associated type `<T as Trait>::A` to `usize`
137    |
138 LL | fn ban<T>(x: T) where T: Trait<A = usize> {
139    |                               +++++++++++
140
141 error: aborting due to 7 previous errors
142
143 For more information about this error, try `rustc --explain E0308`.