Enum rustc_middle::mir::mono::InstantiationMode[][src]

pub enum InstantiationMode {
    GloballyShared {
        may_conflict: bool,
    },
    LocalCopy,
}
Expand description

Describes how a monomorphization will be instantiated in object files.

Variants

GloballyShared

There will be exactly one instance of the given MonoItem. It will have external linkage so that it can be linked to from other codegen units.

Fields of GloballyShared

may_conflict: bool

In some compilation scenarios we may decide to take functions that are typically LocalCopy and instead move them to GloballyShared to avoid codegenning them a bunch of times. In this situation, however, our local copy may conflict with other crates also inlining the same function.

This flag indicates that this situation is occurring, and informs symbol name calculation that some extra mangling is needed to avoid conflicts. Note that this may eventually go away entirely if ThinLTO enables us to always have a globally shared instance of a function within one crate’s compilation.

LocalCopy

Each codegen unit containing a reference to the given MonoItem will have its own private copy of the function (with internal linkage).

Trait Implementations

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

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 be different between compiler versions and platforms. 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: 1 byte

Size for each variant: