]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr
New upstream version 1.76.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / transmute_ptr_to_ptr.stderr
1 error: transmute from a pointer to a pointer
2 --> $DIR/transmute_ptr_to_ptr.rs:30:29
3 |
4 LL | let _: *const f32 = std::mem::transmute(ptr);
5 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr as *const f32`
6 |
7 = note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
8 = help: to override `-D warnings` add `#[allow(clippy::transmute_ptr_to_ptr)]`
9
10 error: transmute from a pointer to a pointer
11 --> $DIR/transmute_ptr_to_ptr.rs:33:27
12 |
13 LL | let _: *mut f32 = std::mem::transmute(mut_ptr);
14 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mut_ptr as *mut f32`
15
16 error: transmute from a reference to a reference
17 --> $DIR/transmute_ptr_to_ptr.rs:36:23
18 |
19 LL | let _: &f32 = std::mem::transmute(&1u32);
20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
21
22 error: transmute from a reference to a reference
23 --> $DIR/transmute_ptr_to_ptr.rs:38:23
24 |
25 LL | let _: &f64 = std::mem::transmute(&1f32);
26 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1f32 as *const f32 as *const f64)`
27
28 error: transmute from a reference to a reference
29 --> $DIR/transmute_ptr_to_ptr.rs:42:27
30 |
31 LL | let _: &mut f32 = std::mem::transmute(&mut 1u32);
32 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
33
34 error: transmute from a reference to a reference
35 --> $DIR/transmute_ptr_to_ptr.rs:44:37
36 |
37 LL | let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
39
40 error: transmute from a reference to a reference
41 --> $DIR/transmute_ptr_to_ptr.rs:47:38
42 |
43 LL | let u64_ref: &u64 = unsafe { std::mem::transmute(u8_ref) };
44 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(u8_ref as *const u8 as *const u64)`
45
46 error: aborting due to 7 previous errors
47