Incorrect explicit_outlives_requirements
error
#119228
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
playground link
Current output
Desired output
Rationale and extra context
If I remove the outlives bound like the warning suggests, I then get:
So the outlives bound not only couldn't be inferred, but was required.
Other cases
If I don't make
MyTypeContext
recursive, then the bound is not warned as inferrable. This compiles without warnings (playground):And weirdly
OtherContext
does not require'tcx: 'thir
to compile, whereas the recursiveMyTypeContext
did. I'm not sure what the correct behavior is but that seems inconsistent.I just realized that this requires
#![warn(explicit_outlives_requirements)]
which is turned on when working on rustc but is actually allow-by-default for other rust users.The text was updated successfully, but these errors were encountered: