1
Fork 0

ScalarInt: add methods to assert being a (u)int of given size

This commit is contained in:
Ralf Jung 2024-04-18 08:38:37 +02:00
parent 5e6184cdb7
commit 42220f0930
13 changed files with 78 additions and 72 deletions

View file

@ -420,7 +420,7 @@ pub(crate) mod rustc {
fn from_tag(tag: ScalarInt, tcx: TyCtxt<'tcx>) -> Self {
use rustc_target::abi::Endian;
let size = tag.size();
let bits = tag.to_bits(size).unwrap();
let bits = tag.assert_bits(size);
let bytes: [u8; 16];
let bytes = match tcx.data_layout.endian {
Endian::Little => {