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
|
@ -249,7 +249,7 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> {
|
|||
}
|
||||
|
||||
/// Return the immediate as a `ScalarInt`. Ensures that it has the size that the layout of the
|
||||
/// immediate indcates.
|
||||
/// immediate indicates.
|
||||
#[inline]
|
||||
pub fn to_scalar_int(&self) -> InterpResult<'tcx, ScalarInt> {
|
||||
let s = self.to_scalar().to_scalar_int()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue