pub struct MirFunction {
pub id: MirFnId,
pub name: String,
pub type_params: Vec<(String, Vec<String>)>,
pub params: Vec<MirParam>,
pub return_type: Option<String>,
pub body: MirBody,
pub is_nogc: bool,
pub cfg_body: Option<MirCfg>,
pub decorators: Vec<String>,
pub vis: Visibility,
}Expand description
A MIR function definition.
Contains both the tree-form MirBody and an optional CFG representation.
The tree-form body is canonical after lowering; the CFG is built on demand
via build_cfg for analyses that require
explicit control-flow edges (SSA, dominators, loop analysis).
Lambda-lifted closures and the synthetic __main entry function are
represented as regular MirFunction instances.
Fields§
§id: MirFnIdUnique function ID within the program.
name: StringFunction name. Lambda-lifted closures use __closure_N names.
Impl methods use Target.method qualified names.
type_params: Vec<(String, Vec<String>)>Generic type parameters as (param_name, trait_bounds) pairs.
params: Vec<MirParam>Function parameters in declaration order.
return_type: Option<String>Return type name, if explicitly annotated.
body: MirBodyTree-form function body (statements + optional tail expression).
is_nogc: boolWhether this function is annotated with @nogc.
When true, the nogc_verify module rejects any GC-triggering operations.
cfg_body: Option<MirCfg>CFG representation of this function’s body.
Built lazily from tree-form body via build_cfg().
When present, this is the canonical representation for the CFG executor.
decorators: Vec<String>Decorator names applied to this function (e.g., @memoize, @trace).
vis: VisibilityVisibility of this function definition.
Implementations§
Source§impl MirFunction
impl MirFunction
Trait Implementations§
Source§impl Clone for MirFunction
impl Clone for MirFunction
Source§fn clone(&self) -> MirFunction
fn clone(&self) -> MirFunction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more