2024-12-13 06:44:52 +01:00
|
|
|
error[E0594]: cannot assign to `*ptr`, which is behind a `*const` pointer
|
|
|
|
|
--> $DIR/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.rs:7:14
|
|
|
|
|
|
|
|
|
|
|
LL | unsafe { *ptr = 3; }
|
|
|
|
|
| ^^^^^^^^ `ptr` is a `*const` pointer, so the data it refers to cannot be written
|
2024-12-16 20:39:31 +01:00
|
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable pointer
|
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - let ptr = &raw const val;
|
|
|
|
|
LL + let ptr = &raw mut val;
|
|
|
|
|
|
|
2024-12-13 06:44:52 +01:00
|
|
|
|
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0594`.
|