The bounded integer payload from rustc_middle::ty::consts::int::ScalarInt.
The packed Rust layout is not semantically relevant here; construction keeps
the payload truncated to its nonzero 1–16 byte width. Invalid sizes and
source panics are returned explicitly.
- sizeError (reason : ABI.SizeError) : ScalarIntError
- zeroSize : ScalarIntError
- sizeTooLarge (size : ABI.Size) : ScalarIntError
- sizeMismatch (expected actual : ABI.Size) : ScalarIntError
- integerOutsideI128 (value : Int) : ScalarIntError
- integerConversionOverflow (value : Int) : ScalarIntError
- invalidBool (value : UInt8) : ScalarIntError
- invalidChar (value : UInt32) : ScalarIntError
- invalidAtomicOrdering (value : UInt32) : ScalarIntError
- invalidSimdAlignment (value : UInt32) : ScalarIntError
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
- relaxed : AtomicOrdering
- release : AtomicOrdering
- acquire : AtomicOrdering
- acqRel : AtomicOrdering
- seqCst : AtomicOrdering
Instances For
@[instance_reducible]
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- unaligned : SimdAlignment
- element : SimdAlignment
- vector : SimdAlignment
Instances For
@[instance_reducible]
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- rawData : Miri.ABI.U128
- byteSize : Miri.ABI.Size
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- self.size = Miri.Memory.ScalarInt.byteSize✝ self
Instances For
Equations
- self.data = Miri.Memory.ScalarInt.rawData✝ self
Instances For
Equations
- Miri.Memory.ScalarInt.null size = do let _ ← Miri.Memory.ScalarInt.checkedWidth✝ size pure { rawData := 0, byteSize := size }
Instances For
Equations
- self.isNull = (Miri.Memory.ScalarInt.rawData✝ self == 0)
Instances For
Equations
- Miri.Memory.ScalarInt.trueValue = { rawData := 1, byteSize := Miri.ABI.Size.ofBytes 1 }
Instances For
Equations
- Miri.Memory.ScalarInt.falseValue = { rawData := 0, byteSize := Miri.ABI.Size.ofBytes 1 }
Instances For
Return low bits plus the source truncation flag. size remains a checked
source domain: zero and widths above 128 bits cannot become valid scalars.
Equations
- Miri.Memory.ScalarInt.truncateFromUInt value size = Miri.Memory.ScalarInt.truncated✝ value size
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Signed input is an arbitrary Lean integer; first enforce Rust's i128 domain, then preserve its two's-complement bits before truncating.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Miri.Memory.ScalarInt.ofUInt8 value = { rawData := BitVec.ofNat 128 value.toNat, byteSize := Miri.ABI.Size.ofBytes 1 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofUInt16 value = { rawData := BitVec.ofNat 128 value.toNat, byteSize := Miri.ABI.Size.ofBytes 2 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofUInt32 value = { rawData := BitVec.ofNat 128 value.toNat, byteSize := Miri.ABI.Size.ofBytes 4 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofUInt64 value = { rawData := BitVec.ofNat 128 value.toNat, byteSize := Miri.ABI.Size.ofBytes 8 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofUInt128 value = { rawData := value, byteSize := Miri.ABI.Size.ofBytes 16 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofInt8 value = { rawData := BitVec.ofNat 128 value.toUInt8.toNat, byteSize := Miri.ABI.Size.ofBytes 1 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofInt16 value = { rawData := BitVec.ofNat 128 value.toUInt16.toNat, byteSize := Miri.ABI.Size.ofBytes 2 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofInt32 value = { rawData := BitVec.ofNat 128 value.toUInt32.toNat, byteSize := Miri.ABI.Size.ofBytes 4 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofInt64 value = { rawData := BitVec.ofNat 128 value.toUInt64.toNat, byteSize := Miri.ABI.Size.ofBytes 8 }
Instances For
Equations
- Miri.Memory.ScalarInt.ofInt128 value = { rawData := value, byteSize := Miri.ABI.Size.ofBytes 16 }
Instances For
Equations
Instances For
Equations
Instances For
The source's exact-size check is explicit instead of a Lean panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- self.toBitsUnchecked = Miri.Memory.ScalarInt.rawData✝ self
Instances For
Instances For
Equations
- self.toInt expectedSize = do let bits ← self.toBits expectedSize Except.mapError Miri.Memory.ScalarIntError.sizeError (expectedSize.signExtend bits)
Instances For
Equations
- self.toUInt8 = do let __do_lift ← self.toUInt (Miri.ABI.Size.ofBytes 1) pure (UInt8.ofNat (BitVec.toNat __do_lift))
Instances For
Equations
- self.toUInt16 = do let __do_lift ← self.toUInt (Miri.ABI.Size.ofBytes 2) pure (UInt16.ofNat (BitVec.toNat __do_lift))
Instances For
Equations
- self.toUInt32 = do let __do_lift ← self.toUInt (Miri.ABI.Size.ofBytes 4) pure (UInt32.ofNat (BitVec.toNat __do_lift))
Instances For
Equations
- self.toUInt64 = do let __do_lift ← self.toUInt (Miri.ABI.Size.ofBytes 8) pure (UInt64.ofNat (BitVec.toNat __do_lift))
Instances For
Equations
- self.toUInt128 = self.toUInt (Miri.ABI.Size.ofBytes 16)
Instances For
Equations
- self.toInt8 = do let __do_lift ← self.toInt (Miri.ABI.Size.ofBytes 1) pure (Int8.ofInt __do_lift)
Instances For
Equations
- self.toInt16 = do let __do_lift ← self.toInt (Miri.ABI.Size.ofBytes 2) pure (Int16.ofInt __do_lift)
Instances For
Equations
- self.toInt32 = do let __do_lift ← self.toInt (Miri.ABI.Size.ofBytes 4) pure (Int32.ofInt __do_lift)
Instances For
Equations
- self.toInt64 = do let __do_lift ← self.toInt (Miri.ABI.Size.ofBytes 8) pure (Int64.ofInt __do_lift)
Instances For
Equations
- self.toInt128 = self.toInt (Miri.ABI.Size.ofBytes 16)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.