Struct rustc_metadata::creader::CStore[−][src]

pub struct CStore {
    metas: IndexVec<CrateNum, Option<Lrc<CrateMetadata>>>,
    injected_panic_runtime: Option<CrateNum>,
    allocator_kind: Option<AllocatorKind>,
    has_global_allocator: bool,
    stable_crate_ids: FxHashMap<StableCrateId, CrateNum>,
    unused_externs: Vec<Symbol>,
}

Fields

metas: IndexVec<CrateNum, Option<Lrc<CrateMetadata>>>injected_panic_runtime: Option<CrateNum>allocator_kind: Option<AllocatorKind>
Expand description

This crate needs an allocator and either provides it itself, or finds it in a dependency. If the above is true, then this field denotes the kind of the found allocator.

has_global_allocator: bool
Expand description

This crate has a #[global_allocator] item.

stable_crate_ids: FxHashMap<StableCrateId, CrateNum>
Expand description

This map is used to verify we get no hash conflicts between StableCrateId values.

unused_externs: Vec<Symbol>
Expand description

Unused externs of the crate

Implementations

impl CStore[src]

pub fn struct_field_names_untracked(
    &self,
    def: DefId,
    sess: &Session
) -> Vec<Spanned<Symbol>>
[src]

pub fn item_children_untracked(
    &self,
    def_id: DefId,
    sess: &Session
) -> Vec<Export<HirId>>
[src]

pub fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro[src]

pub fn associated_item_cloned_untracked(
    &self,
    def: DefId,
    sess: &Session
) -> AssocItem
[src]

pub fn crate_source_untracked(&self, cnum: CrateNum) -> CrateSource[src]

pub fn get_span_untracked(&self, def_id: DefId, sess: &Session) -> Span[src]

pub fn item_generics_num_lifetimes(
    &self,
    def_id: DefId,
    sess: &Session
) -> usize
[src]

pub fn module_expansion_untracked(
    &self,
    def_id: DefId,
    sess: &Session
) -> ExpnId
[src]

pub fn item_attrs(&self, def_id: DefId, sess: &Session) -> Vec<Attribute>[src]

impl CStore[src]

pub(crate) fn from_tcx(tcx: TyCtxt<'_>) -> &CStore[src]

fn alloc_new_crate_num(&mut self) -> CrateNum[src]

pub(crate) fn get_crate_data(&self, cnum: CrateNum) -> CrateMetadataRef<'_>[src]

fn set_crate_data(&mut self, cnum: CrateNum, data: CrateMetadata)[src]

pub(crate) fn iter_crate_data(&self, f: impl FnMut(CrateNum, &CrateMetadata))[src]

fn push_dependencies_in_postorder(
    &self,
    deps: &mut Vec<CrateNum>,
    cnum: CrateNum
)
[src]

pub(crate) fn crate_dependencies_in_postorder(
    &self,
    cnum: CrateNum
) -> Vec<CrateNum>
[src]

fn crate_dependencies_in_reverse_postorder(
    &self,
    cnum: CrateNum
) -> Vec<CrateNum>
[src]

pub(crate) fn injected_panic_runtime(&self) -> Option<CrateNum>[src]

pub(crate) fn allocator_kind(&self) -> Option<AllocatorKind>[src]

pub(crate) fn has_global_allocator(&self) -> bool[src]

pub fn report_unused_deps(&self, tcx: TyCtxt<'_>)[src]

Trait Implementations

impl Clone for CStore[src]

fn clone(&self) -> CStore[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl CrateStore for CStore[src]

fn def_key(&self, def: DefId) -> DefKey[src]

Returns the DefKey for a given DefId. This indicates the parent DefId as well as some idea of what kind of data the DefId refers to.

fn as_any(&self) -> &dyn Any[src]

fn crate_name_untracked(&self, cnum: CrateNum) -> Symbol[src]

fn crate_is_private_dep_untracked(&self, cnum: CrateNum) -> bool[src]

fn crate_disambiguator_untracked(&self, cnum: CrateNum) -> CrateDisambiguator[src]

fn crate_hash_untracked(&self, cnum: CrateNum) -> Svh[src]

fn def_kind(&self, def: DefId) -> DefKind[src]

fn def_path(&self, def: DefId) -> DefPath[src]

fn def_path_hash(&self, def: DefId) -> DefPathHash[src]

fn def_path_hash_to_def_id(
    &self,
    cnum: CrateNum,
    index_guess: u32,
    hash: DefPathHash
) -> Option<DefId>
[src]

fn crates_untracked(&self) -> Vec<CrateNum>[src]

fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata[src]

fn metadata_encoding_version(&self) -> &[u8][src]

fn allocator_kind(&self) -> Option<AllocatorKind>[src]

Auto Trait Implementations

impl !RefUnwindSafe for CStore

impl !Send for CStore

impl !Sync for CStore

impl Unpin for CStore

impl !UnwindSafe for CStore

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]