mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
6494bd0bac
This reverts commit 0e803417f9
.
Fixed by https://github.com/rust-lang/rustfmt/issues/4528.
22 lines
863 B
Text
22 lines
863 B
Text
error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
|
|
--> $DIR/cast_ref_to_mut.rs:18:9
|
|
|
|
|
LL | (*(a as *const _ as *mut String)).push_str(" world");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::cast-ref-to-mut` implied by `-D warnings`
|
|
|
|
error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
|
|
--> $DIR/cast_ref_to_mut.rs:19:9
|
|
|
|
|
LL | *(a as *const _ as *mut _) = String::from("Replaced");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
|
|
--> $DIR/cast_ref_to_mut.rs:20:9
|
|
|
|
|
LL | *(a as *const _ as *mut String) += " world";
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 3 previous errors
|
|
|