Closed
Description
const ARRAY: *mut [u32; 4] = 0x12345678 as _;
pub unsafe fn test(val: u32) {
(*ARRAY)[0] = val;
}
Warning: attempting to modify a `const` item
--> <source>:4:5
|
4 | (*ARRAY)[0] = val;
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(const_item_mutation)]` on by default
= note: each usage of a `const` item creates a new temporary; the original `const` item will not be modified
note: `const` item defined here
--> <source>:1:1
|
1 | const ARRAY: *mut [u32; 4] = 0x12345678 as _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#77324 missed that case.