]> git.proxmox.com Git - rustc.git/blame - src/test/ui/associated-types/issue-87261.stderr
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / associated-types / issue-87261.stderr
CommitLineData
94222f64
XL
1error[E0271]: type mismatch resolving `<A as Trait>::Associated == ()`
2 --> $DIR/issue-87261.rs:56:5
3 |
4LL | accepts_trait(a);
5 | ^^^^^^^^^^^^^ expected `()`, found associated type
6 |
7 = note: expected unit type `()`
8 found associated type `<A as Trait>::Associated`
9note: required by a bound in `accepts_trait`
10 --> $DIR/issue-87261.rs:43:27
11 |
12LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
13 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
14help: consider constraining the associated type `<A as Trait>::Associated` to `()`
15 |
16LL | A: Trait<Associated = ()> + 'static,
17 | +++++++++++++++++
18
19error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
20 --> $DIR/issue-87261.rs:59:5
21 |
22LL | accepts_trait(b);
23 | ^^^^^^^^^^^^^ expected `()`, found associated type
24 |
25 = note: expected unit type `()`
26 found associated type `<B as Trait>::Associated`
27 = help: consider constraining the associated type `<B as Trait>::Associated` to `()`
28 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
29note: required by a bound in `accepts_trait`
30 --> $DIR/issue-87261.rs:43:27
31 |
32LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
33 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
34
35error[E0271]: type mismatch resolving `<C as Trait>::Associated == ()`
36 --> $DIR/issue-87261.rs:62:5
37 |
38LL | accepts_trait(c);
39 | ^^^^^^^^^^^^^ expected `()`, found associated type
40 |
41 = note: expected unit type `()`
42 found associated type `<C as Trait>::Associated`
43note: required by a bound in `accepts_trait`
44 --> $DIR/issue-87261.rs:43:27
45 |
46LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
47 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
48help: consider constraining the associated type `<C as Trait>::Associated` to `()`
49 |
50LL | C: Trait<Associated = ()> + Foo,
51 | +++++++++++++++++
52
53error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
54 --> $DIR/issue-87261.rs:65:5
55 |
56LL | accepts_trait(d);
57 | ^^^^^^^^^^^^^ expected `()`, found associated type
58 |
59 = note: expected unit type `()`
60 found associated type `<D as Trait>::Associated`
61 = help: consider constraining the associated type `<D as Trait>::Associated` to `()`
62 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
63note: required by a bound in `accepts_trait`
64 --> $DIR/issue-87261.rs:43:27
65 |
66LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
67 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
68
69error[E0271]: type mismatch resolving `<E as GenericTrait<()>>::Associated == ()`
70 --> $DIR/issue-87261.rs:68:5
71 |
72LL | accepts_generic_trait(e);
73 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
74 |
75 = note: expected unit type `()`
76 found associated type `<E as GenericTrait<()>>::Associated`
77note: required by a bound in `accepts_generic_trait`
78 --> $DIR/issue-87261.rs:44:46
79 |
80LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
81 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
82help: consider constraining the associated type `<E as GenericTrait<()>>::Associated` to `()`
83 |
84LL | E: GenericTrait<(), Associated = ()> + 'static,
85 | +++++++++++++++++
86
87error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
88 --> $DIR/issue-87261.rs:71:5
89 |
90LL | accepts_generic_trait(f);
91 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
92 |
93 = note: expected unit type `()`
94 found associated type `<F as GenericTrait<()>>::Associated`
95note: required by a bound in `accepts_generic_trait`
96 --> $DIR/issue-87261.rs:44:46
97 |
98LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
99 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
100help: consider constraining the associated type `<F as GenericTrait<()>>::Associated` to `()`
101 |
102LL | F: GenericTrait<(), Associated = ()> + Foo,
103 | +++++++++++++++++
104
105error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
106 --> $DIR/issue-87261.rs:74:5
107 |
108LL | accepts_generic_trait(g);
109 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
110 |
111 = note: expected unit type `()`
112 found associated type `<G as GenericTrait<()>>::Associated`
113 = help: consider constraining the associated type `<G as GenericTrait<()>>::Associated` to `()`
114 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
115note: required by a bound in `accepts_generic_trait`
116 --> $DIR/issue-87261.rs:44:46
117 |
118LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
119 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
120
121error[E0271]: type mismatch resolving `<impl Trait as Trait>::Associated == ()`
122 --> $DIR/issue-87261.rs:79:5
123 |
124LL | fn returns_opaque() -> impl Trait + 'static {
125 | -------------------- the found opaque type
126...
127LL | accepts_trait(returns_opaque());
128 | ^^^^^^^^^^^^^ expected `()`, found associated type
129 |
130 = note: expected unit type `()`
131 found associated type `<impl Trait as Trait>::Associated`
132note: required by a bound in `accepts_trait`
133 --> $DIR/issue-87261.rs:43:27
134 |
135LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
136 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
137help: consider constraining the associated type `<impl Trait as Trait>::Associated` to `()`
138 |
139LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
140 | +++++++++++++++++
141
142error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
143 --> $DIR/issue-87261.rs:82:5
144 |
145LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static {
146 | --------------------------- the found opaque type
147...
148LL | accepts_trait(returns_opaque_derived());
149 | ^^^^^^^^^^^^^ expected `()`, found associated type
150 |
151 = note: expected unit type `()`
152 found associated type `<impl DerivedTrait as Trait>::Associated`
153note: required by a bound in `accepts_trait`
154 --> $DIR/issue-87261.rs:43:27
155 |
156LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
157 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
158help: consider constraining the associated type `<impl DerivedTrait as Trait>::Associated` to `()`
159 |
160LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
161 | +++++++++++++++++
162
923072b8 163error[E0271]: type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
94222f64
XL
164 --> $DIR/issue-87261.rs:85:5
165 |
166LL | fn returns_opaque_foo() -> impl Trait + Foo {
167 | ---------------- the found opaque type
168...
169LL | accepts_trait(returns_opaque_foo());
170 | ^^^^^^^^^^^^^ expected `()`, found associated type
171 |
172 = note: expected unit type `()`
923072b8 173 found associated type `<impl Trait + Foo as Trait>::Associated`
94222f64
XL
174note: required by a bound in `accepts_trait`
175 --> $DIR/issue-87261.rs:43:27
176 |
177LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
178 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
923072b8 179help: consider constraining the associated type `<impl Trait + Foo as Trait>::Associated` to `()`
94222f64
XL
180 |
181LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
182 | +++++++++++++++++
183
923072b8 184error[E0271]: type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
94222f64
XL
185 --> $DIR/issue-87261.rs:88:5
186 |
187LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
188 | ----------------------- the found opaque type
189...
190LL | accepts_trait(returns_opaque_derived_foo());
191 | ^^^^^^^^^^^^^ expected `()`, found associated type
192 |
193 = note: expected unit type `()`
923072b8
FG
194 found associated type `<impl DerivedTrait + Foo as Trait>::Associated`
195 = help: consider constraining the associated type `<impl DerivedTrait + Foo as Trait>::Associated` to `()`
94222f64
XL
196 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
197note: required by a bound in `accepts_trait`
198 --> $DIR/issue-87261.rs:43:27
199 |
200LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
201 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
202
203error[E0271]: type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
204 --> $DIR/issue-87261.rs:91:5
205 |
206LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
207 | ------------------------------- the found opaque type
208...
209LL | accepts_generic_trait(returns_opaque_generic());
210 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
211 |
212 = note: expected unit type `()`
213 found associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated`
214note: required by a bound in `accepts_generic_trait`
215 --> $DIR/issue-87261.rs:44:46
216 |
217LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
218 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
219help: consider constraining the associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated` to `()`
220 |
221LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
222 | +++++++++++++++++
223
923072b8 224error[E0271]: type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
94222f64
XL
225 --> $DIR/issue-87261.rs:94:5
226 |
227LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
228 | --------------------------- the found opaque type
229...
230LL | accepts_generic_trait(returns_opaque_generic_foo());
231 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
232 |
233 = note: expected unit type `()`
923072b8 234 found associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated`
94222f64
XL
235note: required by a bound in `accepts_generic_trait`
236 --> $DIR/issue-87261.rs:44:46
237 |
238LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
239 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
923072b8 240help: consider constraining the associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated` to `()`
94222f64
XL
241 |
242LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo {
243 | +++++++++++++++++
244
923072b8 245error[E0271]: type mismatch resolving `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
94222f64
XL
246 --> $DIR/issue-87261.rs:97:5
247 |
248LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
249 | ---------------------------------------- the found opaque type
250...
251LL | accepts_generic_trait(returns_opaque_generic_duplicate());
252 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
253 |
254 = note: expected unit type `()`
923072b8
FG
255 found associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated`
256 = help: consider constraining the associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated` to `()`
94222f64
XL
257 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
258note: required by a bound in `accepts_generic_trait`
259 --> $DIR/issue-87261.rs:44:46
260 |
261LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
262 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
263
264error: aborting due to 14 previous errors
265
266For more information about this error, try `rustc --explain E0271`.