* `-Zmiri-retag-fields` changes Stacked Borrows retagging to recurse into fields.
This means that references in fields of structs/enums/tuples/arrays/... are retagged,
and in particular, they are protected when passed as function arguments.
+* `-Zmiri-retag-fields=<all|none|scalar>` controls when Stacked Borrows retagging recurses into
+ fields. `all` means it always recurses (like `-Zmiri-retag-fields`), `none` means it never
+ recurses (the default), `scalar` means it only recurses for types where we would also emit
+ `noalias` annotations in the generated LLVM IR (types passed as indivudal scalars or pairs of
+ scalars).
* `-Zmiri-tag-gc=<blocks>` configures how often the pointer tag garbage collector runs. The default
is to search for and remove unreachable tags once every `10000` basic blocks. Setting this to
`0` disables the garbage collector, which causes some programs to have explosive memory usage
fn miri_start_panic(payload: *mut u8) -> !;
/// Miri-provided extern function to get the internal unique identifier for the allocation that a pointer
- /// points to. This is only useful as an input to `miri_print_stacks`, and it is a separate call because
+ /// points to. If this pointer is invalid (not pointing to an allocation), interpretation will abort.
+ ///
+ /// This is only useful as an input to `miri_print_borrow_stacks`, and it is a separate call because
/// getting a pointer to an allocation at runtime can change the borrow stacks in the allocation.
+ /// This function should be considered unstable. It exists only to support `miri_print_borrow_stacks` and so
+ /// inherits all of its instability.
fn miri_get_alloc_id(ptr: *const ()) -> u64;
/// Miri-provided extern function to print (from the interpreter, not the program) the contents of all
- /// borrow stacks in an allocation. The format of what this emits is unstable and may change at any time.
- /// In particular, users should be aware that Miri will periodically attempt to garbage collect the
- /// contents of all stacks. Callers of this function may wish to pass `-Zmiri-tag-gc=0` to disable the GC.
- fn miri_print_stacks(alloc_id: u64);
+ /// borrow stacks in an allocation. The leftmost tag is the bottom of the stack.
+ /// The format of what this emits is unstable and may change at any time. In particular, users should be
+ /// aware that Miri will periodically attempt to garbage collect the contents of all stacks. Callers of
+ /// this function may wish to pass `-Zmiri-tag-gc=0` to disable the GC.
+ ///
+ /// This function is extremely unstable. At any time the format of its output may change, its signature may
+ /// change, or it may be removed entirely.
+ fn miri_print_borrow_stacks(alloc_id: u64);
/// Miri-provided extern function to print (from the interpreter, not the
/// program) the contents of a section of program memory, as bytes. Bytes