-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Uncertain maybe-incorrect suggestion for impl_trait_overcaptures #132932
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-edition-2024Area: The 2024 editionArea: The 2024 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-editionDiagnostics: An error or lint that should account for edition differences.Diagnostics: An error or lint that should account for edition differences.L-impl_trait_overcapturesLint: impl_trait_overcapturesLint: impl_trait_overcapturesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-edition-2024Area: The 2024 editionArea: The 2024 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-editionDiagnostics: An error or lint that should account for edition differences.Diagnostics: An error or lint that should account for edition differences.L-impl_trait_overcapturesLint: impl_trait_overcapturesLint: impl_trait_overcapturesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is mostly a question for @compiler-errors (and really just an edition-guide issue). This is regarding the maybe-incorrect suggestion for
impl_trait_overcapturesin the following specific scenario:https://crater-reports.s3.amazonaws.com/pr-132712/try%23da25749bf5e6ba5ed862ff361c19afff2a986b2d/reg/srdf-0.1.52/log.txt
where the general code looks like:
This generates the
impl_trait_overcaptureswith maybe-incorrect applicability.The question I have is that I do not see this scenario described in https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html, and thus left being uncertain about why it thinks it is maybe incorrect. I assume it is something to do with the associated types, but it wasn't immediately obvious how to minimize this scenario.
If this isn't already documented on https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html about why it might be wrong to blindly follow the compiler, would it be possible to describe the scenario and what considerations the author should take before accepting the suggestion?
Meta
rustc --version --verbose: