Invalid suggestion on missing lifetime in impl trait associated type #68904
Labels
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Trying to elide lifetimes in an associated type of an impl trait causes rustc to emit some suggestions that contain invalid Rust syntax.
I tried this code:
I expected to see this happen: an error is emitted, possibly with a suggestion of adding a generic lifetime parameter.
Instead, this happened: the suggestion contains invalid Rust syntax, where the lifetime appears as if the parameter type was the generic parameter list:
rustc --version --verbose:
rustc 1.43.0-nightly (58b8343 2020-02-05)
binary: rustc
commit-hash: 58b8343
commit-date: 2020-02-05
host: x86_64-unknown-linux-gnu
release: 1.43.0-nightly
LLVM version: 9.0
The text was updated successfully, but these errors were encountered: