summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr')
-rw-r--r--src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr b/src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr
new file mode 100644
index 000000000..49a8a3347
--- /dev/null
+++ b/src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr
@@ -0,0 +1,40 @@
+error: transmute from a pointer to a pointer
+ --> $DIR/transmute_ptr_to_ptr.rs:30:29
+ |
+LL | let _: *const f32 = std::mem::transmute(ptr);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr as *const f32`
+ |
+ = note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
+
+error: transmute from a pointer to a pointer
+ --> $DIR/transmute_ptr_to_ptr.rs:31:27
+ |
+LL | let _: *mut f32 = std::mem::transmute(mut_ptr);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mut_ptr as *mut f32`
+
+error: transmute from a reference to a reference
+ --> $DIR/transmute_ptr_to_ptr.rs:33:23
+ |
+LL | let _: &f32 = std::mem::transmute(&1u32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
+
+error: transmute from a reference to a reference
+ --> $DIR/transmute_ptr_to_ptr.rs:34:23
+ |
+LL | let _: &f64 = std::mem::transmute(&1f32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1f32 as *const f32 as *const f64)`
+
+error: transmute from a reference to a reference
+ --> $DIR/transmute_ptr_to_ptr.rs:37:27
+ |
+LL | let _: &mut f32 = std::mem::transmute(&mut 1u32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
+
+error: transmute from a reference to a reference
+ --> $DIR/transmute_ptr_to_ptr.rs:38:37
+ |
+LL | let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
+
+error: aborting due to 6 previous errors
+