[][src]Function cranelift_codegen_meta::cdsl::type_inference::infer_definition

fn infer_definition(
    def: &Def,
    var_pool: &mut VarPool,
    type_env: TypeEnvironment,
    last_type_index: &mut usize
) -> Result<TypeEnvironment, String>

Perform type inference on one Def in the current type environment and return an updated type environment or error.

At a high level this works by creating fresh copies of each formal type var in the Def's instruction's signature, and unifying the formal typevar with the corresponding actual typevar.