Collect all basic blocks reachable after a call blockβs normal return, or β
for a non-call block such as a raw-pointer deref statement β after the block
itself (all of its successors).
Try to extract raw bytes from a MIR constant operand that is a reference
to a byte array/slice (e.g. b"hello\0"). Returns the byte values.
Used by the VM to populate byte-level tracking for constant C strings.
Resolve an array length const (ty::Const) to a concrete u64. Unlike
try_to_target_usize, this also evaluates unevaluated const expressions
(e.g. [MaybeUninit<K>; CAPACITY] where CAPACITY = 2 * B - 1), so the
VM can allocate the array with its true element count instead of a
collapsed zero-size fallback.
Whether def_idβs body (or any callee it would inline) contains a
trait-method call with no executable MIR (a still-generic T: Bound or
virtual dispatch) and no symbolic model β i.e. a call whose opaque
fallback would lose dataflow and therefore benefits from caller
monomorphization.
Map a resolved [Instance] to its concrete target DefId and whether the
dispatch is virtual. None for kinds with no single target (e.g. a closureβs
Clone shim).
Whether def_id is a single-field struct wrapping a raw pointer (i.e.
NonNull-shaped). Used by alias/ownership reasoning to recognize pointer
wrappers β including local re-implementations β by their structure rather
than by a std DefId.
Whether def is a SizedTypeProperties::<ASSOC> associated const β a
compiler-internal layout constant (SIZE, ALIGN, IS_ZST) that has no
lang/diagnostic item, so it is matched by its def-path suffix.
Compute the full type layout, catching rustc panics and layout errors.
Shared by type_layout and the symbolic VMβs size/align/field-offset
queries so the layout_of call and its panic-guard live in one place.
Max align_of over all implementors of a generic type parameterβs trait
bounds (0 for non-param types or a parameter without a bounded set of
implementors).
If constant is a promoted offset_of!(Container, field) constant (an
unevaluated Const whose body is a call to the offset_of intrinsic),
return the container type.
Resolve a const item (e.g. const CAPACITY: usize = 2 * B - 1) by name in
the local crate to its evaluated unsigned-integer value, for use in the
contract DSL (ValidNum(len <= CAPACITY)).
Resolve a cfg!-style runtime-check flag (UbChecks, ContractChecks,
OverflowChecks) to a constant u64. We fold to the no-check edge (0):
the check only panics on a violated precondition, and its branchy body would
otherwise corrupt field/Typed propagation during inlining. Rustc lowers
these to Operand::RuntimeChecks.
Whether a SwitchIntβs non-otherwise targets all lead straight to
panic/unreachable (a debug_assert!/assert! dispatch). Such a switch
is dead on the normal path and can be inlined by following only the
otherwise edge.
Enumerate the concrete impl methods that could be dispatched for a trait
method (the set of targets behind a trait-object / virtual call). Each
returned DefId is an implβs override of method_def_id.
Whether a type transitively contains a raw pointer, recursing through tuple
elements and Adt fields. Unlike type_contains_reference, this does not
match references β a method returning &*self.raw re-borrows the pointee
(safe) rather than leaking the raw pointer value itself (unsafe).
Enumerate the concrete self types implementing a type parameterβs trait
bounds. Chooses the bound with the fewest concrete (non-generic) impls β
the βsmallβ helper trait that usually pins the supported types (e.g.
GetDisjointMutIndex over the generic SliceIndex/Clone bounds) β and
returns its concrete impl self types.