False negative for unused_mut
when writing to field through reference
#110849
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
Code
I tried this code:
I expected to see this: The compiler should tell me to remove the
mut
, since it isn't necessary:Instead this happened: The code compiles without a lint.
The lint triggers correctly with an explicit reborrow:
(&mut *x).0 = 1;
Meta
playground 1.71.0-nightly (2023-04-25 458d4da)
@rustbot label A-diagnostics A-lint
The text was updated successfully, but these errors were encountered: