"use of undeclared lifetime" error on async method has invalid suggestion (lifetime in parameter position) #75850
Labels
A-lifetimes
Area: Lifetimes / regions
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.
Minimal reproducer:
In both stable (
rustc 1.45.2 (d3fb005a3 2020-07-31)
) and nightly (rustc 1.47.0-nightly (663d2f5cd 2020-08-22)
) I get this error:If I make the method a top-level function, or if I drop the
&self
parameter to make it an associated function, the issue goes away and rustc correctly suggestsbuggy<'somelifetime>()
.The text was updated successfully, but these errors were encountered: