A out-of-air lifetime that that may not live long vs. the implementation is not general enough #131821
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-higher-ranked
Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)
A-NLL
Area: Non-lexical lifetimes (NLL)
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
NLL-diagnostics
Working towards the "diagnostic parity" goal
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
The closure parameter is explicitly specified as
&'static i32
, where does the lifetime'l
come from? Moreover, the lifetime'static
should outlive any lifetime, however, the diagnosis instead saysPresumably, the implementation of trait
FnOnce
for the closure type is only for'static
, which is not general enough.Other cases
No response
Rust Version
rustc 1.81.0 (eeb90cd 2024-09-04)
binary: rustc
commit-hash: eeb90cd
commit-date: 2024-09-04
host: x86_64-apple-darwin
release: 1.81.0
LLVM version: 18.1.7
Anything else?
No response
The text was updated successfully, but these errors were encountered: