RS.CLIPPY.DEREF_ADDROF
Use of `*&` or `*&mut` in an expression
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: deref_addrof. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for usage of *& and *&mut in expressions.
Why is this bad?
Immediately dereferencing a reference is no-op and makes the code less clear.
Known problems
Multiple dereference/addrof pairs are not handled so
the suggested fix for x = **&&y is x = *&y, which is still incorrect.
Example
let a = f(*&mut b);
let c = *&d;
Use instead:
let a = f(b);
let c = d;