@@ -348,20 +348,20 @@ impl<'mir, 'tcx> super::Machine<'mir, 'tcx> for CompileTimeEvaluator {
348
348
"ctpop" | "cttz" | "cttz_nonzero" | "ctlz" | "ctlz_nonzero" | "bswap" => {
349
349
let ty = substs. type_at ( 0 ) ;
350
350
let layout_of = ecx. layout_of ( ty) ?;
351
- let num = ecx. value_to_scalar ( args[ 0 ] ) ?. to_bits ( layout_of. size ) ?;
351
+ let bits = ecx. value_to_scalar ( args[ 0 ] ) ?. to_bits ( layout_of. size ) ?;
352
352
let kind = match layout_of. abi {
353
353
ty:: layout:: Abi :: Scalar ( ref scalar) => scalar. value ,
354
354
_ => Err ( :: rustc:: mir:: interpret:: EvalErrorKind :: TypeNotPrimitive ( ty) ) ?,
355
355
} ;
356
- let num = if intrinsic_name. ends_with ( "_nonzero" ) {
357
- if num == 0 {
356
+ let out_val = if intrinsic_name. ends_with ( "_nonzero" ) {
357
+ if bits == 0 {
358
358
return err ! ( Intrinsic ( format!( "{} called on 0" , intrinsic_name) ) ) ;
359
359
}
360
- numeric_intrinsic ( intrinsic_name. trim_right_matches ( "_nonzero" ) , num , kind) ?
360
+ numeric_intrinsic ( intrinsic_name. trim_right_matches ( "_nonzero" ) , bits , kind) ?
361
361
} else {
362
- numeric_intrinsic ( intrinsic_name, num , kind) ?
362
+ numeric_intrinsic ( intrinsic_name, bits , kind) ?
363
363
} ;
364
- ecx. write_scalar ( dest, num , ty) ?;
364
+ ecx. write_scalar ( dest, out_val , ty) ?;
365
365
}
366
366
367
367
name => return Err (
0 commit comments