struct Inliner<'tcx> {
    tcx: TyCtxt<'tcx>,
    param_env: ParamEnv<'tcx>,
    codegen_fn_attrs: &'tcx CodegenFnAttrs,
    history: Vec<DefId>,
    changed: bool,
}

Fields

tcx: TyCtxt<'tcx>param_env: ParamEnv<'tcx>codegen_fn_attrs: &'tcx CodegenFnAttrs

Caller codegen attributes.

history: Vec<DefId>

Stack of inlined instances. We only check the DefId and not the substs because we want to avoid inlining cases of polymorphic recursion. The number of DefIds is finite, so checking history is enough to ensure that we do not loop endlessly while inlining.

changed: bool

Indicates that the caller body has been modified.

Implementations

Attempts to inline a callsite into the caller body. When successful returns basic blocks containing the inlined body. Otherwise returns an error describing why inlining didn’t take place.

Returns an error if inlining is not possible based on codegen attributes alone. A success indicates that inlining decision should be based on other criteria.

Returns inlining decision that is based on the examination of callee MIR body. Assumes that codegen attributes have been checked for compatibility already.

If arg is already a temporary, returns it. Otherwise, introduces a fresh temporary T and an instruction T = arg, and returns T.

Introduces a new temporary into the caller body that is live for the duration of the call.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 56 bytes