Module rustc_passes::reachable
source · Expand description
Finds local items that are externally reachable, which means that other crates need access to their compiled machine code or their MIR.
An item is “externally reachable” if it is relevant for other crates. This obviously includes
all public items. However, some of these items cannot be compiled to machine code (because they
are generic), and for some the machine code is not sufficient (because we want to cross-crate
inline them). These items “need cross-crate MIR”. When a reachable function f
needs
cross-crate MIR, then all the functions it calls also become reachable, as they will be
necessary to use the MIR of f
from another crate. Furthermore, an item can become “externally
reachable” by having a const
/const fn
return a pointer to that item, so we also need to
recurse into reachable const
/const fn
.
Structs§
Functions§
- See module-level doc comment above.
- Determines whether this item is recursive for reachability. See
is_recursively_reachable_local
below for details.