Files
rust/tests/ui/impl-trait/recursive-in-exhaustiveness.next.stderr
albab-hasan 3df075cdaa point at the opaque when its hidden type cannot be inferred
the note for an uninferable hidden type now points at the opaque definition, unless the error already points inside it
2026-10-14 16:37:25 +06:00

44 lines
1.3 KiB
Plaintext

error[E0282]: type annotations needed for `(_,)`
--> $DIR/recursive-in-exhaustiveness.rs:19:9
|
LL | let (x,) = (build(x),);
| ^^^^
|
note: cannot infer type of hidden type of opaque
--> $DIR/recursive-in-exhaustiveness.rs:17:22
|
LL | fn build<T>(x: T) -> impl Sized {
| ^^^^^^^^^^
help: consider giving this pattern a type, where the placeholder `_` is specified
|
LL | let (x,): (_,) = (build(x),);
| ++++++
error[E0282]: type annotations needed for `((_,),)`
--> $DIR/recursive-in-exhaustiveness.rs:29:9
|
LL | let (x,) = (build2(x),);
| ^^^^
|
note: cannot infer type of hidden type of opaque
--> $DIR/recursive-in-exhaustiveness.rs:27:23
|
LL | fn build2<T>(x: T) -> impl Sized {
| ^^^^^^^^^^
help: consider giving this pattern a type, where the placeholder `_` is specified
|
LL | let (x,): ((_,),) = (build2(x),);
| +++++++++
error[E0282]: type annotations needed
--> $DIR/recursive-in-exhaustiveness.rs:37:23
|
LL | fn build3<T>(x: T) -> impl Sized {
| ^^^^^^^^^^ cannot infer type
|
= note: cannot infer type of hidden type of opaque
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0282`.