Closed
Description
A let binding with an existential type annotation and without an initializer expression results in error[E0720]: opaque type expands to a recursive type.
#![feature(impl_trait_in_bindings)]
fn foo() {
let _ : impl Copy;
}
error[E0720]: opaque type expands to a recursive type
--> src/lib.rs:4:13
|
4 | let _ : impl Copy;
| ^^^^^^^^^ expands to a recursive type
|
= note: type resolves to itself
The mention of recursion here distracts from the actual problem (the type could not be resolved to/satisfied as a concrete type) and no hint is given how to fix this error.
Related: #66523
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Category: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.`#![feature(impl_trait_in_bindings)]`Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.