]> git.lizzy.rs Git - rust.git/blob - tests/ui/transmute.stderr
Merge pull request #1766 from Manishearth/testing_refactor
[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    = note: #[warn(useless_transmute)] on by default
16
17 warning: transmute from a reference to a pointer
18   --> $DIR/transmute.rs:28:21
19    |
20 28 |     let _: *mut T = core::intrinsics::transmute(t);
21    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `t as *const T as *mut T`
22    |
23    = note: #[warn(useless_transmute)] on by default
24
25 warning: transmute from a reference to a pointer
26   --> $DIR/transmute.rs:30:23
27    |
28 30 |     let _: *const U = core::intrinsics::transmute(t);
29    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `t as *const T as *const U`
30    |
31    = note: #[warn(useless_transmute)] on by default
32
33 warning: transmute from a pointer type (`*const T`) to a reference type (`&T`)
34   --> $DIR/transmute.rs:35:17
35    |
36 35 |     let _: &T = std::mem::transmute(p);
37    |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `&*p`
38    |
39    = note: #[warn(transmute_ptr_to_ref)] on by default
40
41 warning: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
42   --> $DIR/transmute.rs:38:21
43    |
44 38 |     let _: &mut T = std::mem::transmute(m);
45    |                     ^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *m`
46    |
47    = note: #[warn(transmute_ptr_to_ref)] on by default
48
49 warning: transmute from a pointer type (`*mut T`) to a reference type (`&T`)
50   --> $DIR/transmute.rs:41:17
51    |
52 41 |     let _: &T = std::mem::transmute(m);
53    |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `&*m`
54    |
55    = note: #[warn(transmute_ptr_to_ref)] on by default
56
57 warning: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
58   --> $DIR/transmute.rs:44:21
59    |
60 44 |     let _: &mut T = std::mem::transmute(p as *mut T);
61    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *(p as *mut T)`
62    |
63    = note: #[warn(transmute_ptr_to_ref)] on by default
64
65 warning: transmute from a pointer type (`*const U`) to a reference type (`&T`)
66   --> $DIR/transmute.rs:47:17
67    |
68 47 |     let _: &T = std::mem::transmute(o);
69    |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(o as *const T)`
70    |
71    = note: #[warn(transmute_ptr_to_ref)] on by default
72
73 warning: transmute from a pointer type (`*mut U`) to a reference type (`&mut T`)
74   --> $DIR/transmute.rs:50:21
75    |
76 50 |     let _: &mut T = std::mem::transmute(om);
77    |                     ^^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *(om as *mut T)`
78    |
79    = note: #[warn(transmute_ptr_to_ref)] on by default
80
81 warning: transmute from a pointer type (`*mut U`) to a reference type (`&T`)
82   --> $DIR/transmute.rs:53:17
83    |
84 53 |     let _: &T = std::mem::transmute(om);
85    |                 ^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(om as *const T)`
86    |
87    = note: #[warn(transmute_ptr_to_ref)] on by default
88
89 warning: transmute from a pointer type (`*const i32`) to a reference type (`&issue1231::Foo<'_, u8>`)
90   --> $DIR/transmute.rs:64:32
91    |
92 64 |     let _: &Foo<u8> = unsafe { std::mem::transmute::<_, &Foo<_>>(raw) };
93    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const Foo<_>)`
94    |
95    = note: #[warn(transmute_ptr_to_ref)] on by default
96
97 warning: transmute from a pointer type (`*const i32`) to a reference type (`&issue1231::Foo<'_, &u8>`)
98   --> $DIR/transmute.rs:66:33
99    |
100 66 |     let _: &Foo<&u8> = unsafe { std::mem::transmute::<_, &Foo<&_>>(raw) };
101    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const Foo<&_>)`
102    |
103    = note: #[warn(transmute_ptr_to_ref)] on by default
104
105 warning: transmute from a pointer type (`*const i32`) to a reference type (`&u8`)
106   --> $DIR/transmute.rs:70:14
107    |
108 70 |     unsafe { std::mem::transmute::<_, Bar>(raw) };
109    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const u8)`
110    |
111    = note: #[warn(transmute_ptr_to_ref)] on by default
112
113 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
114   --> $DIR/transmute.rs:76:27
115    |
116 76 |         let _: Vec<i32> = core::intrinsics::transmute(my_vec());
117    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
118    |
119    = note: #[warn(useless_transmute)] on by default
120
121 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
122   --> $DIR/transmute.rs:78:27
123    |
124 78 |         let _: Vec<i32> = core::mem::transmute(my_vec());
125    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126    |
127    = note: #[warn(useless_transmute)] on by default
128
129 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
130   --> $DIR/transmute.rs:80:27
131    |
132 80 |         let _: Vec<i32> = std::intrinsics::transmute(my_vec());
133    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134    |
135    = note: #[warn(useless_transmute)] on by default
136
137 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
138   --> $DIR/transmute.rs:82:27
139    |
140 82 |         let _: Vec<i32> = std::mem::transmute(my_vec());
141    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142    |
143    = note: #[warn(useless_transmute)] on by default
144
145 warning: transmute from a type (`std::vec::Vec<i32>`) to itself
146   --> $DIR/transmute.rs:84:27
147    |
148 84 |         let _: Vec<i32> = my_transmute(my_vec());
149    |                           ^^^^^^^^^^^^^^^^^^^^^^
150    |
151    = note: #[warn(useless_transmute)] on by default
152
153 warning: transmute from an integer to a pointer
154   --> $DIR/transmute.rs:92:31
155    |
156 92 |         let _: *const usize = std::mem::transmute(5_isize);
157    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `5_isize as *const usize`
158    |
159    = note: #[warn(useless_transmute)] on by default
160
161 warning: transmute from an integer to a pointer
162   --> $DIR/transmute.rs:96:31
163    |
164 96 |         let _: *const usize = std::mem::transmute(1+1usize);
165    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `(1+1usize) as *const usize`
166    |
167    = note: #[warn(useless_transmute)] on by default
168
169 warning: transmute from a type (`*const Usize`) to the type that it points to (`Usize`)
170    --> $DIR/transmute.rs:111:24
171     |
172 111 |         let _: Usize = core::intrinsics::transmute(int_const_ptr);
173     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174     |
175     = note: #[warn(crosspointer_transmute)] on by default
176
177 warning: transmute from a type (`*mut Usize`) to the type that it points to (`Usize`)
178    --> $DIR/transmute.rs:113:24
179     |
180 113 |         let _: Usize = core::intrinsics::transmute(int_mut_ptr);
181     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182     |
183     = note: #[warn(crosspointer_transmute)] on by default
184
185 warning: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`)
186    --> $DIR/transmute.rs:115:31
187     |
188 115 |         let _: *const Usize = core::intrinsics::transmute(my_int());
189     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
190     |
191     = note: #[warn(crosspointer_transmute)] on by default
192
193 warning: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`)
194    --> $DIR/transmute.rs:117:29
195     |
196 117 |         let _: *mut Usize = core::intrinsics::transmute(my_int());
197     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198     |
199     = note: #[warn(crosspointer_transmute)] on by default
200