Rust

Rust

Made by DeepSource

Detected conversion of *const to *mut RS-S1011

Security
Major
cwe-758

Converting *const to *mut works in safe code. However, mutating such a pointer can result in undefined behavior. Such situations can only occur in unsafe code, because dereferencing pointers is an unsafe operation.

Bad practice

let x = 10;
let foo = &x as *const i32 as *mut i32;

Reference