]> git.lizzy.rs Git - rust.git/blob - tests/ui/cast_ref_to_mut.stderr
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / cast_ref_to_mut.stderr
1 error: casting &T to &mut T may cause undefined behaviour, consider instead using an UnsafeCell
2   --> $DIR/cast_ref_to_mut.rs:18:9
3    |
4 LL |         (*(a as *const _ as *mut String)).push_str(" world");
5    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::cast-ref-to-mut` implied by `-D warnings`
8
9 error: casting &T to &mut T may cause undefined behaviour, consider instead using an UnsafeCell
10   --> $DIR/cast_ref_to_mut.rs:19:9
11    |
12 LL |         *(a as *const _ as *mut _) = String::from("Replaced");
13    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 error: casting &T to &mut T may cause undefined behaviour, consider instead using an UnsafeCell
16   --> $DIR/cast_ref_to_mut.rs:20:9
17    |
18 LL |         *(a as *const _ as *mut String) += " world";
19    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
21 error: aborting due to 3 previous errors
22