]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr
Override rustc version in ui and mir-opt tests to get stable hashes
[rust.git] / src / test / 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    = note:         expected type `usize`
8            found associated type `<impl Trait as Trait>::A`
9 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
10    |
11 LL |     fn foo<'a, T: Trait + 'a>(&self, _: impl Trait, x: impl Trait<A = usize>, _: T) {
12    |                                                                  +++++++++++
13
14 error[E0308]: mismatched types
15   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:17:13
16    |
17 LL |         qux(x.func())
18    |             ^^^^^^^^ expected `usize`, found associated type
19    |
20    = note:         expected type `usize`
21            found associated type `<T as Trait>::A`
22 help: consider constraining the associated type `<T as Trait>::A` to `usize`
23    |
24 LL |     fn ban<T>(x: T) where T: Trait<A = usize> {
25    |                                   +++++++++++
26
27 error[E0308]: mismatched types
28   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:22:9
29    |
30 LL |     qux(x.func())
31    |         ^^^^^^^^ expected `usize`, found associated type
32    |
33    = note:         expected type `usize`
34            found associated type `<impl Trait as Trait>::A`
35 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
36    |
37 LL | fn foo<'a, T: Trait + 'a>(_: impl Trait, x: impl Trait<A = usize>, _: T) {
38    |                                                       +++++++++++
39
40 error[E0308]: mismatched types
41   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:26:9
42    |
43 LL |     qux(x.func())
44    |         ^^^^^^^^ expected `usize`, found associated type
45    |
46    = note:         expected type `usize`
47            found associated type `<T as Trait>::A`
48 help: consider constraining the associated type `<T as Trait>::A` to `usize`
49    |
50 LL | fn bar<T: Trait<A = usize>>(x: T) {
51    |                +++++++++++
52
53 error[E0308]: mismatched types
54   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:30:9
55    |
56 LL |     qux(x.func())
57    |         ^^^^^^^^ expected `usize`, found associated type
58    |
59    = note:         expected type `usize`
60            found associated type `<impl Trait<i32> as Trait<i32>>::A`
61 help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
62    |
63 LL | fn foo2(x: impl Trait<i32, A = usize>) {
64    |                          +++++++++++
65
66 error[E0308]: mismatched types
67   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:34:9
68    |
69 LL |     qux(x.func())
70    |         ^^^^^^^^ expected `usize`, found associated type
71    |
72    = note:         expected type `usize`
73            found associated type `<T as Trait<i32>>::A`
74 help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
75    |
76 LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
77    |                     +++++++++++
78
79 error[E0308]: mismatched types
80   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:38:9
81    |
82 LL |     qux(x.func())
83    |         ^^^^^^^^ expected `usize`, found associated type
84    |
85    = note:         expected type `usize`
86            found associated type `<T as Trait>::A`
87 help: consider constraining the associated type `<T as Trait>::A` to `usize`
88    |
89 LL | fn ban<T>(x: T) where T: Trait<A = usize> {
90    |                               +++++++++++
91
92 error: aborting due to 7 previous errors
93
94 For more information about this error, try `rustc --explain E0308`.