Documentation

Miri.Memory.Pointer

The generic engine pointer from pinned rustc mir/interpret/pointer.rs and the concrete Miri provenance from machine.rs are kept separate. In Miri the offset field is an absolute address; with CTFE provenance it is relative. None of these constructors or wrapping operations establishes dereference validity, liveness, alignment, permission, or initialization.

structure Miri.Memory.Pointer (Prov : Type u) :
Instances For
    def Miri.Memory.instDecidableEqPointer.decEq {Prov✝ : Type u_1} [DecidableEq Prov✝] (x✝ x✝¹ : Pointer Prov✝) :
    Decidable (x✝ = x✝¹)
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Miri.Memory.instReprPointer.repr {Prov✝ : Type u_1} [Repr Prov✝] :
      Pointer Prov✝ → Nat → Std.Format
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[instance_reducible]
        instance Miri.Memory.instReprPointer {Prov✝ : Type u_1} [Repr Prov✝] :
        Repr (Pointer Prov✝)
        Equations

        Errors corresponding to source assertion/try_into failures, not UB.

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

              Target-size operations from PointerArithmetic. Assertions and narrowing conversion failures remain explicit. No target triple is selected here.

              Instances For
                Equations
                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

                        Pinned PointerArithmetic::max_size_of_val, independent of the ABI object-size bound (which is smaller for 64-bit LLVM layouts).

                        Equations
                        Instances For
                          def Miri.Memory.Pointer.new {Prov : Type u_1} (provenance : Prov) (offset : ABI.Size) :
                          Pointer Prov
                          Equations
                          Instances For
                            def Miri.Memory.Pointer.intoRawParts {Prov : Type u_1} (ptr : Pointer Prov) :
                            Equations
                            Instances For
                              def Miri.Memory.Pointer.mapProvenance {Prov : Type u_1} (ptr : Pointer Prov) (f : Prov → Prov) :
                              Pointer Prov
                              Equations
                              Instances For
                                Equations
                                Instances For
                                  Equations
                                  Instances For

                                    Rust Result<Pointer<Prov>, Size>: an address without provenance goes through the error branch, not a fabricated allocation.

                                    Equations
                                    Instances For

                                      Source wraps u64 addition before truncating to the target pointer size.

                                      Equations
                                      Instances For
                                        Equations
                                        Instances For
                                          theorem Miri.Memory.Pointer.map_preserves_offset {Prov : Type u_1} (ptr : Pointer Prov) (f : Prov → Prov) :
                                          theorem Miri.Memory.Pointer.wrappingOffset_preserves_provenance {Prov : Type} (ptr : Pointer Prov) (offset : ABI.Size) (cx : PointerArithmetic) (next : Pointer Prov) (h : ptr.wrappingOffset offset cx = Except.ok next) :