@@ -177,15 +177,12 @@ pub fn represent_type<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
177
177
repr
178
178
}
179
179
180
- macro_rules! repeat_u8_as_u32 {
181
- ( $name: expr) => { ( ( $name as u32 ) << 24 |
182
- ( $name as u32 ) << 16 |
183
- ( $name as u32 ) << 8 |
184
- ( $name as u32 ) ) }
180
+ const fn repeat_u8_as_u32 ( val : u8 ) -> u32 {
181
+ ( val as u32 ) << 24 | ( val as u32 ) << 16 | ( val as u32 ) << 8 | val as u32
185
182
}
186
- macro_rules! repeat_u8_as_u64 {
187
- ( $name : expr ) => { ( ( repeat_u8_as_u32! ( $name ) as u64 ) << 32 |
188
- ( repeat_u8_as_u32! ( $name ) as u64 ) ) }
183
+
184
+ const fn repeat_u8_as_u64 ( val : u8 ) -> u64 {
185
+ ( repeat_u8_as_u32 ( val ) as u64 ) << 32 | repeat_u8_as_u32 ( val ) as u64
189
186
}
190
187
191
188
/// `DTOR_NEEDED_HINT` is a stack-local hint that just means
@@ -203,8 +200,8 @@ pub const DTOR_NEEDED_HINT: u8 = 0x3d;
203
200
pub const DTOR_MOVED_HINT : u8 = 0x2d ;
204
201
205
202
pub const DTOR_NEEDED : u8 = 0xd4 ;
206
- pub const DTOR_NEEDED_U32 : u32 = repeat_u8_as_u32 ! ( DTOR_NEEDED ) ;
207
- pub const DTOR_NEEDED_U64 : u64 = repeat_u8_as_u64 ! ( DTOR_NEEDED ) ;
203
+ pub const DTOR_NEEDED_U32 : u32 = repeat_u8_as_u32 ( DTOR_NEEDED ) ;
204
+ pub const DTOR_NEEDED_U64 : u64 = repeat_u8_as_u64 ( DTOR_NEEDED ) ;
208
205
#[ allow( dead_code) ]
209
206
pub fn dtor_needed_usize ( ccx : & CrateContext ) -> usize {
210
207
match & ccx. tcx ( ) . sess . target . target . target_pointer_width [ ..] {
@@ -215,8 +212,8 @@ pub fn dtor_needed_usize(ccx: &CrateContext) -> usize {
215
212
}
216
213
217
214
pub const DTOR_DONE : u8 = 0x1d ;
218
- pub const DTOR_DONE_U32 : u32 = repeat_u8_as_u32 ! ( DTOR_DONE ) ;
219
- pub const DTOR_DONE_U64 : u64 = repeat_u8_as_u64 ! ( DTOR_DONE ) ;
215
+ pub const DTOR_DONE_U32 : u32 = repeat_u8_as_u32 ( DTOR_DONE ) ;
216
+ pub const DTOR_DONE_U64 : u64 = repeat_u8_as_u64 ( DTOR_DONE ) ;
220
217
#[ allow( dead_code) ]
221
218
pub fn dtor_done_usize ( ccx : & CrateContext ) -> usize {
222
219
match & ccx. tcx ( ) . sess . target . target . target_pointer_width [ ..] {
0 commit comments