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

Describes how a monomorphization will be instantiated in object files.

Variants§

§

GloballyShared

Fields

§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.

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.

§

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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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: 1 byte

Size for each variant:

  • GloballyShared: 1 byte
  • LocalCopy: 0 bytes