@@ -63,7 +63,7 @@ impl Handle {
63
63
let floor_log2 = variant_count. ilog2 ( ) ;
64
64
65
65
// we need to add one for non powers of two to compensate for the difference
66
- #[ allow ( clippy:: arithmetic_side_effects) ] // cannot overflow
66
+ #[ expect ( clippy:: arithmetic_side_effects) ] // cannot overflow
67
67
if variant_count. is_power_of_two ( ) { floor_log2 } else { floor_log2 + 1 }
68
68
}
69
69
@@ -88,8 +88,7 @@ impl Handle {
88
88
89
89
// packs the data into the lower `data_size` bits
90
90
// and packs the discriminant right above the data
91
- #[ allow( clippy:: arithmetic_side_effects) ] // cannot overflow
92
- return discriminant << data_size | data;
91
+ discriminant << data_size | data
93
92
}
94
93
95
94
fn new ( discriminant : u32 , data : u32 ) -> Option < Self > {
@@ -107,11 +106,10 @@ impl Handle {
107
106
let data_size = u32:: BITS . strict_sub ( disc_size) ;
108
107
109
108
// the lower `data_size` bits of this mask are 1
110
- #[ allow ( clippy:: arithmetic_side_effects) ] // cannot overflow
109
+ #[ expect ( clippy:: arithmetic_side_effects) ] // cannot overflow
111
110
let data_mask = 2u32 . pow ( data_size) - 1 ;
112
111
113
112
// the discriminant is stored right above the lower `data_size` bits
114
- #[ allow( clippy:: arithmetic_side_effects) ] // cannot overflow
115
113
let discriminant = handle >> data_size;
116
114
117
115
// the data is stored in the lower `data_size` bits
@@ -123,7 +121,7 @@ impl Handle {
123
121
pub fn to_scalar ( self , cx : & impl HasDataLayout ) -> Scalar {
124
122
// 64-bit handles are sign extended 32-bit handles
125
123
// see https://docs.microsoft.com/en-us/windows/win32/winprog64/interprocess-communication
126
- #[ allow ( clippy:: cast_possible_wrap) ] // we want it to wrap
124
+ #[ expect ( clippy:: cast_possible_wrap) ] // we want it to wrap
127
125
let signed_handle = self . to_packed ( ) as i32 ;
128
126
Scalar :: from_target_isize ( signed_handle. into ( ) , cx)
129
127
}
@@ -134,7 +132,7 @@ impl Handle {
134
132
) -> InterpResult < ' tcx , Option < Self > > {
135
133
let sign_extended_handle = handle. to_target_isize ( cx) ?;
136
134
137
- #[ allow ( clippy:: cast_sign_loss) ] // we want to lose the sign
135
+ #[ expect ( clippy:: cast_sign_loss) ] // we want to lose the sign
138
136
let handle = if let Ok ( signed_handle) = i32:: try_from ( sign_extended_handle) {
139
137
signed_handle as u32
140
138
} else {
0 commit comments