Open
Description
What it does
Warn when the code tries to copy the value behind a reference, then borrow the copy.
Advantage
No response
Drawbacks
No response
Example
fn main() {
let a = &[0u8; 2];
let r = &mut { *a };
}
Similar to https://users.rust-lang.org/t/runtime-speed-when-converting-as-bytes-or-as-ref-to-be-mut/123712/10 that tries to convert a reference to mutably borrow.