Expand description
Run a post-mono pass on MIR, possibly from other crates.
In post-mono MIR, all functions are possible to resolve to an Instance.
This traverses the callgraph along function call edges, starting from mono roots, and stopping
if it sees a function that’s already been checked. See rustc_monomorphize::collector for more
info.
A “mono root” is an externally reachable function, such as main, pub fn, or weird things
such as std::rt::lang_start.
There are three functions in play during this pass.
- The unvalidated function being called, which we call the ‘callee’.
- The generic function being instantiated, which may not be in the current crate, called the ‘caller’.
- The functions that instantiated it (recursively, back to the mono root), which we call the
InstantiationSite.
§Recommended reading
Structs§
- Instantiation
Site 🔒 - Used for diagnostics. See
post_mono. - Lint
Post 🔒Mono
Functions§
- lint_
validated_ roots - Lint all used items recursively, starting from validated roots.
Validated roots are calculated in
rustc_monomorphize::collector::ferrocene, see there for details.