]> git.lizzy.rs Git - rust.git/blob - tests/ui/transmute.stderr
Merge pull request #1847 from Manishearth/nested_while_let
[rust.git] / tests / ui / transmute.stderr
1 warning: transmute from a type (`&'a T`) to itself
2   --> $DIR/transmute.rs:22:20
3    |
4 22 |     let _: &'a T = core::intrinsics::transmute(t);
5    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: #[warn(useless_transmute)] on by default
8
9 warning: transmute from a reference to a pointer
10   --> $DIR/transmute.rs:26:23
11    |
12 26 |     let _: *const T = core::intrinsics::transmute(t);
13    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `t as *const T`
14
15 warning: transmute from a reference to a pointer
16   --> $DIR/transmute.rs:28:21
17    |
18 28 |     let _: *mut T = core::intrinsics::transmute(t);
19    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `t as *const T as *mut T`
20
21 warning: transmute from a reference to a pointer
22   --> $DIR/transmute.rs:30:23
23    |
24 30 |     let _: *const U = core::intrinsics::transmute(t);
25    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `t as *const T as *const U`
26
27 warning: transmute from a pointer type (`*const T`) to a reference type (`&T`)
28   --> $DIR/transmute.rs:35:17
29    |
30 35 |     let _: &T = std::mem::transmute(p);
31    |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `&*p`
32    |
33    = note: #[warn(transmute_ptr_to_ref)] on by default
34
35 warning: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
36   --> $DIR/transmute.rs:38:21
37    |
38 38 |     let _: &mut T = std::mem::transmute(m);
39    |                     ^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *m`
40
41 warning: transmute from a pointer type (`*mut T`) to a reference type (`&T`)
42   --> $DIR/transmute.rs:41:17
43    |
44 41 |     let _: &T = std::mem::transmute(m);
45    |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `&*m`
46
47 warning: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
48   --> $DIR/transmute.rs:44:21
49    |
50 44 |     let _: &mut T = std::mem::transmute(p as *mut T);
51    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *(p as *mut T)`
52
53 warning: transmute from a pointer type (`*const U`) to a reference type (`&T`)
54   --> $DIR/transmute.rs:47:17
55    |
56 47 |     let _: &T = std::mem::transmute(o);
57    |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(o as *const T)`
58
59 warning: transmute from a pointer type (`*mut U`) to a reference type (`&mut T`)
60   --> $DIR/transmute.rs:50:21
61    |
62 50 |     let _: &mut T = std::mem::transmute(om);
63    |                     ^^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *(om as *mut T)`
64
65 warning: transmute from a pointer type (`*mut U`) to a reference type (`&T`)
66   --> $DIR/transmute.rs:53:17
67    |
68 53 |     let _: &T = std::mem::transmute(om);
69    |                 ^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(om as *const T)`
70
71 warning: transmute from a pointer type (`*const i32`) to a reference type (`&issue1231::Foo<'_, u8>`)
72   --> $DIR/transmute.rs:64:32
73    |
74 64 |     let _: &Foo<u8> = unsafe { std::mem::transmute::<_, &Foo<_>>(raw) };
75    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const Foo<_>)`
76
77 warning: transmute from a pointer type (`*const i32`) to a reference type (`&issue1231::Foo<'_, &u8>`)
78   --> $DIR/transmute.rs:66:33
79    |
80 66 |     let _: &Foo<&u8> = unsafe { std::mem::transmute::<_, &Foo<&_>>(raw) };
81    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const Foo<&_>)`
82
83 warning: transmute from a pointer type (`*const i32`) to a reference type (`&u8`)
84   --> $DIR/transmute.rs:70:14
85    |
86 70 |     unsafe { std::mem::transmute::<_, Bar>(raw) };
87    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const u8)`
88
89 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
90   --> $DIR/transmute.rs:76:27
91    |
92 76 |         let _: Vec<i32> = core::intrinsics::transmute(my_vec());
93    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94
95 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
96   --> $DIR/transmute.rs:78:27
97    |
98 78 |         let _: Vec<i32> = core::mem::transmute(my_vec());
99    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
101 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
102   --> $DIR/transmute.rs:80:27
103    |
104 80 |         let _: Vec<i32> = std::intrinsics::transmute(my_vec());
105    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106
107 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
108   --> $DIR/transmute.rs:82:27
109    |
110 82 |         let _: Vec<i32> = std::mem::transmute(my_vec());
111    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112
113 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
114   --> $DIR/transmute.rs:84:27
115    |
116 84 |         let _: Vec<i32> = my_transmute(my_vec());
117    |                           ^^^^^^^^^^^^^^^^^^^^^^
118
119 warning: transmute from an integer to a pointer
120   --> $DIR/transmute.rs:92:31
121    |
122 92 |         let _: *const usize = std::mem::transmute(5_isize);
123    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `5_isize as *const usize`
124
125 warning: transmute from an integer to a pointer
126   --> $DIR/transmute.rs:96:31
127    |
128 96 |         let _: *const usize = std::mem::transmute(1+1usize);
129    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `(1+1usize) as *const usize`
130
131 warning: transmute from a type (`*const Usize`) to the type that it points to (`Usize`)
132    --> $DIR/transmute.rs:111:24
133     |
134 111 |         let _: Usize = core::intrinsics::transmute(int_const_ptr);
135     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136     |
137     = note: #[warn(crosspointer_transmute)] on by default
138
139 warning: transmute from a type (`*mut Usize`) to the type that it points to (`Usize`)
140    --> $DIR/transmute.rs:113:24
141     |
142 113 |         let _: Usize = core::intrinsics::transmute(int_mut_ptr);
143     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144
145 warning: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`)
146    --> $DIR/transmute.rs:115:31
147     |
148 115 |         let _: *const Usize = core::intrinsics::transmute(my_int());
149     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150
151 warning: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`)
152    --> $DIR/transmute.rs:117:29
153     |
154 117 |         let _: *mut Usize = core::intrinsics::transmute(my_int());
155     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156