Struct rustc_hir::Crate[][src]

pub struct Crate<'hir> {
    pub owners: IndexVec<LocalDefId, Option<OwnerNode<'hir>>>,
    pub bodies: BTreeMap<BodyId, Body<'hir>>,
    pub trait_map: FxHashMap<LocalDefId, FxHashMap<ItemLocalId, Box<[TraitCandidate]>>>,
    pub attrs: BTreeMap<HirId, &'hir [Attribute]>,
}
Expand description

The top-level data structure that stores the entire contents of the crate currently being compiled.

For more details, see the rustc dev guide.

Fields

owners: IndexVec<LocalDefId, Option<OwnerNode<'hir>>>bodies: BTreeMap<BodyId, Body<'hir>>trait_map: FxHashMap<LocalDefId, FxHashMap<ItemLocalId, Box<[TraitCandidate]>>>

Map indicating what traits are in scope for places where this is relevant; generated by resolve.

attrs: BTreeMap<HirId, &'hir [Attribute]>

Collected attributes from HIR nodes.

Implementations

Visits all items in the crate in some deterministic (but unspecified) order. If you just need to process every item, but don’t care about nesting, this method is the best choice.

If you do care about nesting – usually because your algorithm follows lexical scoping rules – then you want a different approach. You should override visit_nested_item in your visitor and then call intravisit::walk_crate instead.

A parallel version of visit_all_item_likes.

Trait Implementations

Formats the value using the given formatter. 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

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 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: 104 bytes