Skip to content

Try to point out when edition 2024 lifetime capture rules cause borrowck issues#131186

Merged
bors merged 2 commits intorust-lang:masterfrom
compiler-errors:precise-capturing-borrowck
Oct 31, 2024
Merged

Try to point out when edition 2024 lifetime capture rules cause borrowck issues#131186
bors merged 2 commits intorust-lang:masterfrom
compiler-errors:precise-capturing-borrowck

Conversation

@compiler-errors
Copy link
Copy Markdown
Contributor

@compiler-errors compiler-errors commented Oct 3, 2024

Lifetime capture rules in 2024 are modified to capture more lifetimes, which sometimes lead to some non-local borrowck errors. This PR attempts to link these back together with a useful note pointing out the capture rule changes.

This is not a blocking concern, but I'd appreciate feedback (though, again, I'd like to stress that I don't want to block this PR on this): I'm worried about this note drowning in the sea of other diagnostics that borrowck emits. I was tempted to change the level of the note to .span_warn just so it would show up in a different color. Thoughts?

Fixes #130545

Opening as a draft first since it's stacked on #131183.
r? @ghost

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve borrow checking error in cases where + use<> could be used

6 participants