@@ -155,14 +155,14 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
155
155
} )
156
156
} ;
157
157
158
- let clamp = |n| {
158
+ let trunc = |n| {
159
159
let gcx = self . tcx . global_tcx ( ) ;
160
160
let param_ty = self . param_env . and ( gcx. lift ( & ty) . unwrap ( ) ) ;
161
161
let bit_width = gcx. layout_of ( param_ty) . unwrap ( ) . size . bits ( ) ;
162
- trace ! ( "clamp {} with size {} and amt {}" , n, bit_width, 128 - bit_width) ;
162
+ trace ! ( "trunc {} with size {} and amt {}" , n, bit_width, 128 - bit_width) ;
163
163
let amt = 128 - bit_width;
164
164
let result = ( n << amt) >> amt;
165
- trace ! ( "clamp result: {}" , result) ;
165
+ trace ! ( "trunc result: {}" , result) ;
166
166
ConstValue :: Scalar ( Scalar :: Bits {
167
167
bits : result,
168
168
defined : bit_width as u8 ,
@@ -193,9 +193,9 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
193
193
LitKind :: Int ( n, _) if neg => {
194
194
let n = n as i128 ;
195
195
let n = n. overflowing_neg ( ) . 0 ;
196
- clamp ( n as u128 )
196
+ trunc ( n as u128 )
197
197
} ,
198
- LitKind :: Int ( n, _) => clamp ( n) ,
198
+ LitKind :: Int ( n, _) => trunc ( n) ,
199
199
LitKind :: Float ( n, fty) => {
200
200
parse_float ( n, fty)
201
201
}
0 commit comments