]> git.proxmox.com Git - rustc.git/blob - tests/ui/suggestions/trait-with-missing-associated-type-restriction.stderr
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / ui / suggestions / trait-with-missing-associated-type-restriction.stderr
1 error[E0308]: mismatched types
2 --> $DIR/trait-with-missing-associated-type-restriction.rs:10:31
3 |
4 LL | fn funq(&self) -> Self::A {}
5 | ^^ expected associated type, found `()`
6 |
7 = note: expected associated type `<Self as Trait<T>>::A`
8 found unit type `()`
9 help: a method is available that returns `<Self as Trait<T>>::A`
10 --> $DIR/trait-with-missing-associated-type-restriction.rs:8:5
11 |
12 LL | fn func(&self) -> Self::A;
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ consider calling `Trait::func`
14
15 error[E0308]: mismatched types
16 --> $DIR/trait-with-missing-associated-type-restriction.rs:14:9
17 |
18 LL | qux(x.func())
19 | --- ^^^^^^^^ expected `usize`, found associated type
20 | |
21 | arguments to this function are incorrect
22 |
23 = note: expected type `usize`
24 found associated type `<impl Trait as Trait>::A`
25 note: function defined here
26 --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
27 |
28 LL | fn qux(_: usize) {}
29 | ^^^ --------
30 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
31 |
32 LL | fn foo(_: impl Trait, x: impl Trait<A = usize>) {
33 | +++++++++++
34
35 error[E0308]: mismatched types
36 --> $DIR/trait-with-missing-associated-type-restriction.rs:18:9
37 |
38 LL | qux(x.func())
39 | --- ^^^^^^^^ expected `usize`, found associated type
40 | |
41 | arguments to this function are incorrect
42 |
43 = note: expected type `usize`
44 found associated type `<T as Trait>::A`
45 note: function defined here
46 --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
47 |
48 LL | fn qux(_: usize) {}
49 | ^^^ --------
50 help: consider constraining the associated type `<T as Trait>::A` to `usize`
51 |
52 LL | fn bar<T: Trait<A = usize>>(x: T) {
53 | +++++++++++
54
55 error[E0308]: mismatched types
56 --> $DIR/trait-with-missing-associated-type-restriction.rs:22:9
57 |
58 LL | qux(x.func())
59 | --- ^^^^^^^^ expected `usize`, found associated type
60 | |
61 | arguments to this function are incorrect
62 |
63 = note: expected type `usize`
64 found associated type `<impl Trait<i32> as Trait<i32>>::A`
65 note: function defined here
66 --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
67 |
68 LL | fn qux(_: usize) {}
69 | ^^^ --------
70 help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
71 |
72 LL | fn foo2(x: impl Trait<i32, A = usize>) {
73 | +++++++++++
74
75 error[E0308]: mismatched types
76 --> $DIR/trait-with-missing-associated-type-restriction.rs:26:12
77 |
78 LL | x.funk(3);
79 | ---- ^ expected associated type, found integer
80 | |
81 | arguments to this method are incorrect
82 |
83 = note: expected associated type `<T as Trait<i32>>::A`
84 found type `{integer}`
85 help: some methods are available that return `<T as Trait<i32>>::A`
86 --> $DIR/trait-with-missing-associated-type-restriction.rs:8:5
87 |
88 LL | fn func(&self) -> Self::A;
89 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ consider calling `Trait::func`
90 LL | fn funk(&self, _: Self::A);
91 LL | fn funq(&self) -> Self::A {}
92 | ^^^^^^^^^^^^^^^^^^^^^^^^^ consider calling `Trait::funq`
93 note: method defined here
94 --> $DIR/trait-with-missing-associated-type-restriction.rs:9:8
95 |
96 LL | fn funk(&self, _: Self::A);
97 | ^^^^
98 help: consider constraining the associated type `<T as Trait<i32>>::A` to `{integer}`
99 |
100 LL | fn bar2<T: Trait<i32, A = {integer}>>(x: T) {
101 | +++++++++++++++
102
103 error[E0308]: mismatched types
104 --> $DIR/trait-with-missing-associated-type-restriction.rs:27:9
105 |
106 LL | qux(x.func())
107 | --- ^^^^^^^^ expected `usize`, found associated type
108 | |
109 | arguments to this function are incorrect
110 |
111 = note: expected type `usize`
112 found associated type `<T as Trait<i32>>::A`
113 note: function defined here
114 --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
115 |
116 LL | fn qux(_: usize) {}
117 | ^^^ --------
118 help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
119 |
120 LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
121 | +++++++++++
122
123 error[E0308]: mismatched types
124 --> $DIR/trait-with-missing-associated-type-restriction.rs:31:9
125 |
126 LL | fn baz<D: std::fmt::Debug, T: Trait<A = D>>(x: T) {
127 | - this type parameter
128 LL | qux(x.func())
129 | --- ^^^^^^^^ expected `usize`, found type parameter `D`
130 | |
131 | arguments to this function are incorrect
132 |
133 = note: expected type `usize`
134 found type parameter `D`
135 note: function defined here
136 --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
137 |
138 LL | fn qux(_: usize) {}
139 | ^^^ --------
140
141 error[E0308]: mismatched types
142 --> $DIR/trait-with-missing-associated-type-restriction.rs:35:9
143 |
144 LL | qux(x.func())
145 | --- ^^^^^^^^ expected `usize`, found `()`
146 | |
147 | arguments to this function are incorrect
148 |
149 note: function defined here
150 --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
151 |
152 LL | fn qux(_: usize) {}
153 | ^^^ --------
154
155 error[E0308]: mismatched types
156 --> $DIR/trait-with-missing-associated-type-restriction.rs:39:9
157 |
158 LL | qux(x.func())
159 | --- ^^^^^^^^ expected `usize`, found associated type
160 | |
161 | arguments to this function are incorrect
162 |
163 = note: expected type `usize`
164 found associated type `<T as Trait>::A`
165 note: function defined here
166 --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
167 |
168 LL | fn qux(_: usize) {}
169 | ^^^ --------
170 help: consider constraining the associated type `<T as Trait>::A` to `usize`
171 |
172 LL | fn ban<T>(x: T) where T: Trait<A = usize> {
173 | +++++++++++
174
175 error: aborting due to 9 previous errors
176
177 For more information about this error, try `rustc --explain E0308`.