summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/transmute_ref_to_ref.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/transmute_ref_to_ref.stderr')
-rw-r--r--src/tools/clippy/tests/ui/transmute_ref_to_ref.stderr26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/transmute_ref_to_ref.stderr b/src/tools/clippy/tests/ui/transmute_ref_to_ref.stderr
new file mode 100644
index 000000000..cc6b156b1
--- /dev/null
+++ b/src/tools/clippy/tests/ui/transmute_ref_to_ref.stderr
@@ -0,0 +1,26 @@
+error: transmute from a reference to a reference
+ --> $DIR/transmute_ref_to_ref.rs:9:39
+ |
+LL | let bools: &[bool] = unsafe { std::mem::transmute(single_u64) };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(single_u64 as *const [u64] as *const [bool])`
+ |
+note: the lint level is defined here
+ --> $DIR/transmute_ref_to_ref.rs:3:9
+ |
+LL | #![deny(clippy::transmute_ptr_to_ptr)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: transmute from a reference to a reference
+ --> $DIR/transmute_ref_to_ref.rs:12:33
+ |
+LL | let b: &[u8] = unsafe { std::mem::transmute(a) };
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(a as *const [u32] as *const [u8])`
+
+error: transmute from a reference to a reference
+ --> $DIR/transmute_ref_to_ref.rs:15:42
+ |
+LL | let alt_slice: &[u32] = unsafe { core::mem::transmute(bytes) };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(bytes as *const [u8] as *const [u32])`
+
+error: aborting due to 3 previous errors
+