Skip to content

Commit 97a0d46

Browse files
committed
Rename num -> bits and num -> out_val
1 parent 8939fe6 commit 97a0d46

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: src/librustc_mir/interpret/const_eval.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -348,20 +348,20 @@ impl<'mir, 'tcx> super::Machine<'mir, 'tcx> for CompileTimeEvaluator {
348348
"ctpop" | "cttz" | "cttz_nonzero" | "ctlz" | "ctlz_nonzero" | "bswap" => {
349349
let ty = substs.type_at(0);
350350
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)?;
352352
let kind = match layout_of.abi {
353353
ty::layout::Abi::Scalar(ref scalar) => scalar.value,
354354
_ => Err(::rustc::mir::interpret::EvalErrorKind::TypeNotPrimitive(ty))?,
355355
};
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 {
358358
return err!(Intrinsic(format!("{} called on 0", intrinsic_name)));
359359
}
360-
numeric_intrinsic(intrinsic_name.trim_right_matches("_nonzero"), num, kind)?
360+
numeric_intrinsic(intrinsic_name.trim_right_matches("_nonzero"), bits, kind)?
361361
} else {
362-
numeric_intrinsic(intrinsic_name, num, kind)?
362+
numeric_intrinsic(intrinsic_name, bits, kind)?
363363
};
364-
ecx.write_scalar(dest, num, ty)?;
364+
ecx.write_scalar(dest, out_val, ty)?;
365365
}
366366

367367
name => return Err(

0 commit comments

Comments
 (0)