Skip to main content

Module post_mono

Module post_mono 

Source
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.

  1. The unvalidated function being called, which we call the ‘callee’.
  2. The generic function being instantiated, which may not be in the current crate, called the ‘caller’.
  3. The functions that instantiated it (recursively, back to the mono root), which we call the InstantiationSite.

Structs§

InstantiationSite 🔒
Used for diagnostics. See post_mono.
LintPostMono 🔒

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.