Skip to content

Conversation

@JohnTitor
Copy link
Member

@JohnTitor JohnTitor commented Feb 7, 2026

Fixes #81059
r? @estebank as you should have some context here, but feel free to re-assign if you don't have time to review right now.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 7, 2026
Comment on lines +12 to +19
help: consider making the binding mutable if you need to reborrow multiple times
|
LL | fn test(mut outer: &mut Option<i32>) {
| +++
help: to reborrow the mutable reference, add `*`
|
LL | match (&mut *outer, 23) {
| +
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a discussion point, maybe we should dedup help annotations.
I don't have strong preference and would like to follow someone's favor.

@rust-log-analyzer

This comment has been minimized.

@JohnTitor JohnTitor force-pushed the sugg-mut-deref-borrows branch from 9d683c6 to 0de7415 Compare February 7, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error message improvement: Manual reborrowing with &mut *variable

4 participants