Skip to content

Commit 8939fe6

Browse files
committed
Rename bytes -> bits
1 parent 0d7d5e9 commit 8939fe6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -593,20 +593,20 @@ pub fn const_eval_provider<'a, 'tcx>(
593593

594594
fn numeric_intrinsic<'tcx>(
595595
name: &str,
596-
bytes: u128,
596+
bits: u128,
597597
kind: Primitive,
598598
) -> EvalResult<'tcx, Scalar> {
599599
let defined = match kind {
600600
Primitive::Int(integer, _) => integer.size().bits() as u8,
601-
_ => bug!("invalid `{}` argument: {:?}", name, bytes),
601+
_ => bug!("invalid `{}` argument: {:?}", name, bits),
602602
};
603603
let extra = 128 - defined as u128;
604-
let bytes_out = match name {
605-
"ctpop" => bytes.count_ones() as u128,
606-
"ctlz" => bytes.leading_zeros() as u128 - extra,
607-
"cttz" => (bytes << extra).trailing_zeros() as u128 - extra,
608-
"bswap" => (bytes << extra).swap_bytes(),
604+
let bits_out = match name {
605+
"ctpop" => bits.count_ones() as u128,
606+
"ctlz" => bits.leading_zeros() as u128 - extra,
607+
"cttz" => (bits << extra).trailing_zeros() as u128 - extra,
608+
"bswap" => (bits << extra).swap_bytes(),
609609
_ => bug!("not a numeric intrinsic: {}", name),
610610
};
611-
Ok(Scalar::Bits { bits: bytes_out, defined })
611+
Ok(Scalar::Bits { bits: bits_out, defined })
612612
}

0 commit comments

Comments
 (0)