[−][src]Struct rustc_codegen_ssa::CrateInfo

pub struct CrateInfo {
    pub panic_runtime: Option<CrateNum>,
    pub compiler_builtins: Option<CrateNum>,
    pub profiler_runtime: Option<CrateNum>,
    pub is_no_builtins: FxHashSet<CrateNum>,
    pub native_libraries: FxHashMap<CrateNum, Lrc<Vec<NativeLib>>>,
    pub crate_name: FxHashMap<CrateNum, String>,
    pub used_libraries: Lrc<Vec<NativeLib>>,
    pub link_args: Lrc<Vec<String>>,
    pub used_crate_source: FxHashMap<CrateNum, Lrc<CrateSource>>,
    pub used_crates_static: Vec<(CrateNum, LibSource)>,
    pub used_crates_dynamic: Vec<(CrateNum, LibSource)>,
    pub lang_item_to_crate: FxHashMap<LangItem, CrateNum>,
    pub missing_lang_items: FxHashMap<CrateNum, Vec<LangItem>>,
    pub dependency_formats: Lrc<Dependencies>,
}

Misc info we load from metadata to persist beyond the tcx.

Note: though CrateNum is only meaningful within the same tcx, information within CrateInfo is self-contained. CrateNum can be viewed as a unique identifier within a CrateInfo, where used_crate_source contains all CrateSource of the dependents, and maintains a mapping from identifiers (CrateNum) to CrateSource. The other fields map CrateNum to the crate's own additional properties, so that effectively we can retrieve each dependent crate's CrateSource and the corresponding properties without referencing information outside of a CrateInfo.

Fields

panic_runtime: Option<CrateNum>compiler_builtins: Option<CrateNum>profiler_runtime: Option<CrateNum>is_no_builtins: FxHashSet<CrateNum>native_libraries: FxHashMap<CrateNum, Lrc<Vec<NativeLib>>>crate_name: FxHashMap<CrateNum, String>used_libraries: Lrc<Vec<NativeLib>>link_args: Lrc<Vec<String>>used_crate_source: FxHashMap<CrateNum, Lrc<CrateSource>>used_crates_static: Vec<(CrateNum, LibSource)>used_crates_dynamic: Vec<(CrateNum, LibSource)>lang_item_to_crate: FxHashMap<LangItem, CrateNum>missing_lang_items: FxHashMap<CrateNum, Vec<LangItem>>dependency_formats: Lrc<Dependencies>

Implementations

impl CrateInfo[src]

pub fn new(tcx: TyCtxt<'_>) -> CrateInfo[src]

Trait Implementations

impl Debug for CrateInfo[src]

impl<__D: Decoder> Decodable<__D> for CrateInfo[src]

impl<__E: Encoder> Encodable<__E> for CrateInfo[src]

Auto Trait Implementations

impl !RefUnwindSafe for CrateInfo

impl !Send for CrateInfo

impl !Sync for CrateInfo

impl Unpin for CrateInfo

impl !UnwindSafe for CrateInfo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.