2018-12-30 13:11:53 +01:00
|
|
|
error: casting &T to &mut T may cause undefined behaviour, consider instead using an UnsafeCell
|
2018-12-29 19:25:27 +01:00
|
|
|
--> $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`
|
|
|
|
|
2018-12-30 13:11:53 +01:00
|
|
|
error: casting &T to &mut T may cause undefined behaviour, consider instead using an UnsafeCell
|
2018-12-29 19:25:27 +01:00
|
|
|
--> $DIR/cast_ref_to_mut.rs:19:9
|
|
|
|
|
|
|
|
|
LL | *(a as *const _ as *mut _) = String::from("Replaced");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2018-12-30 13:11:53 +01:00
|
|
|
error: casting &T to &mut T may cause undefined behaviour, consider instead using an UnsafeCell
|
2018-12-29 19:25:27 +01:00
|
|
|
--> $DIR/cast_ref_to_mut.rs:20:9
|
|
|
|
|
|
|
|
|
LL | *(a as *const _ as *mut String) += " world";
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|