Documentation

Miri.ABI.Size

The machine-width size primitives from rustc_abi::Size.

The upstream source stores byte counts in u64, and stores integer values in u128. Lean 4 has no UInt128, so U128 is represented by BitVec 128; this preserves the source machine width and wrapping behavior. Operations that panic in upstream return an explicit Except error here.

A structural equality decider for the standard Except result type.

@[instance_reducible]
instance Miri.ABI.instDecidableEqExcept_miri {ε : Type u_1} {α : Type u_2} [DecidableEq ε] [DecidableEq α] :
Equations
  • One or more equations did not get rendered due to their size.
@[reducible, inline]
Equations
Instances For
    Instances For
      @[instance_reducible]
      Equations
      @[instance_reducible]
      Equations

      The relevant projection of rustc_abi's target-dependent data layout.

      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

            The actual caller interface used by rustc_abi Size::checked_add/mul: the caller supplies a data-layout value, from which the object-size bound is read.

            Instances
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  Instances For
                    @[instance_reducible]
                    Equations
                    • One or more equations did not get rendered due to their size.
                    structure Miri.ABI.Size :
                    Instances For
                      def Miri.ABI.instDecidableEqSize.decEq (x✝ x✝¹ : Size) :
                      Decidable (x✝ = x✝¹)
                      Equations
                      Instances For
                        @[instance_reducible]
                        Equations
                        Equations
                        Instances For
                          @[inline]
                          Equations
                          Instances For
                            @[inline]
                            Equations
                            Instances For

                              div_ceil(8) written without the overflowing bits + 7 formulation.

                              @[inline]
                              Equations
                              Instances For
                                @[inline]
                                Equations
                                Instances For
                                  @[inline]
                                  Equations
                                  Instances For
                                    @[inline]
                                    Equations
                                    Instances For
                                      @[inline]
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        @[inline]
                                        Equations
                                        Instances For
                                          @[inline]
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            Checked target-layout addition. This mirrors the upstream exclusive bound: the resulting byte count must be strictly less than obj_size_bound().

                                            @[inline]
                                            def Miri.ABI.Size.checkedAdd {α : Type} [HasDataLayout α] (size offset : Size) (cx : α) :
                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              @[inline]
                                              def Miri.ABI.Size.checkedMul {α : Type} [HasDataLayout α] (size : Size) (count : UInt64) (cx : α) :
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For

                                                Truncate a u128 value to the low Size.bits bits. The error case corresponds to the upstream primitive's overflowing bits() or shift.

                                                @[inline]
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  Truncate to Size.bits and interpret the resulting bits as a signed two's-complement i128.

                                                  @[inline]
                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    @[inline]
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      @[inline]
                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        @[inline]
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For