]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/cast_ref_to_mut.stderr
Add 'src/tools/clippy/' from commit 'd2708873ef711ec8ab45df1e984ecf24a96cd369'
[rust.git] / src / tools / clippy / tests / ui / cast_ref_to_mut.stderr
1 error: casting `&T` to `&mut T` may cause undefined behavior, 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 behavior, 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 behavior, 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