diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/cast_ref_to_mut.stderr')
-rw-r--r-- | src/tools/clippy/tests/ui/cast_ref_to_mut.stderr | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/cast_ref_to_mut.stderr b/src/tools/clippy/tests/ui/cast_ref_to_mut.stderr new file mode 100644 index 000000000..aacd99437 --- /dev/null +++ b/src/tools/clippy/tests/ui/cast_ref_to_mut.stderr @@ -0,0 +1,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 + |