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