Mismatched lifetime in trait function declaration is not detected #48812
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
fixed-by-NLL
Bugs fixed, but only when NLL is enabled.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider the following code:
The compiler errors out failing to infer an appropriate lifetime:
But the most immediate error is that the declaration of
from_str
doesn't match the trait definition, missing the lifetime bound on&str
to match the lifetime associated with the trait.The text was updated successfully, but these errors were encountered: