summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/cast_ref_to_mut.stderr
blob: aacd99437d9fc3eadde5b8a60a5b0a11e9de8b30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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