pub struct Function {
pub name: String,
pub params: u32,
pub takes_env: bool,
pub capture_count: u32,
pub temps: Vec<MirTy>,
pub ret: MirTy,
pub is_async: bool,
pub blocks: Vec<Block>,
}Expand description
A monomorphized function.
Fields§
§name: StringMangled, unique symbol name (e.g. identity.7$i); the entry point is
the sole exception, emitted under the bare symbol main.
params: u32Number of real value parameters (the first params temps after the
optional leading environment pointer).
takes_env: boolWhether the ABI has a leading environment pointer (closures and
bare-fn wrappers). When true, temp 0 is the env pointer, temps
1..=params are the real parameters, and capture_count captured
values are loaded from the environment at entry.
capture_count: u32§temps: Vec<MirTy>§ret: MirTy§is_async: boolStill awaiting the async state-machine transform: this function was
lowered from an async fn body, so ret is the class of the value the
BODY produces, not of the Future<T> its signature declares.
No function reaching a codegen backend has this set.
lower_module runs async_lower::transform over the finished module,
which rewrites every such function into a poll function plus a wrapper
and clears the flag. A function that still carried it would be emitted
under its original symbol with the wrong return class — invisible
wherever the output type happens to share a register class with a
pointer, a verifier error where it does not.
blocks: Vec<Block>