ScalarInt: add methods to assert being a (u)int of given size
This commit is contained in:
parent
5e6184cdb7
commit
42220f0930
13 changed files with 78 additions and 72 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue