79764222

Date: 2025-09-14 10:09:15
Score: 0.5
Natty:
Report link

The lint is warning because you are taking a mutable reference to a const item in order to call a method that requires &mut self. That mutable reference is to a fresh temporary copy of the const value (the NonNull), not to the original const item. In your specific pattern, that borrowed temporary is only used to manufacture a &'_ mut T pointing at 0x1234, so the const itself is not being mutated. The real risk is the usual unsafe aliasing/validity obligations of turning a raw address into a mutable reference.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: windtalker