pub struct Tables<'tcx> {
    pub tcx: TyCtxt<'tcx>,
    pub def_ids: Vec<DefId>,
    pub types: Vec<Ty<'tcx>>,
}

Fields§

§tcx: TyCtxt<'tcx>§def_ids: Vec<DefId>§types: Vec<Ty<'tcx>>

Implementations§

source§

impl<'tcx> Tables<'tcx>

source

pub fn item_def_id(&self, item: &CrateItem) -> DefId

source

pub fn crate_item(&mut self, did: DefId) -> CrateItem

source

pub fn adt_def(&mut self, did: DefId) -> AdtDef

source

pub fn foreign_def(&mut self, did: DefId) -> ForeignDef

source

pub fn fn_def(&mut self, did: DefId) -> FnDef

source

pub fn closure_def(&mut self, did: DefId) -> ClosureDef

source

pub fn generator_def(&mut self, did: DefId) -> GeneratorDef

source

pub fn alias_def(&mut self, did: DefId) -> AliasDef

source

pub fn param_def(&mut self, did: DefId) -> ParamDef

source

pub fn br_named_def(&mut self, did: DefId) -> BrNamedDef

source

pub fn trait_def(&mut self, did: DefId) -> TraitDef

source

fn create_def_id(&mut self, did: DefId) -> DefId

source§

impl<'tcx> Tables<'tcx>

source

fn intern_ty(&mut self, ty: Ty<'tcx>) -> Ty

Trait Implementations§

source§

impl<'tcx> Context for Tables<'tcx>

source§

fn local_crate(&self) -> Crate

Get information about the local crate.
source§

fn external_crates(&self) -> Vec<Crate>

Retrieve a list of all external crates.
source§

fn find_crate(&self, name: &str) -> Option<Crate>

Find a crate with the given name.
source§

fn all_local_items(&mut self) -> CrateItems

Retrieve all items of the local crate that have a MIR associated with them.
source§

fn entry_fn(&mut self) -> Option<CrateItem>

source§

fn mir_body(&mut self, item: &CrateItem) -> Body

source§

fn rustc_tables(&mut self, f: &mut dyn FnMut(&mut Tables<'_>))

HACK: Until we have fully stable consumers, we need an escape hatch to get DefIds out of CrateItems.
source§

fn ty_kind(&mut self, ty: Ty) -> TyKind

Obtain the representation of a type.

Auto Trait Implementations§

§

impl<'tcx> !RefUnwindSafe for Tables<'tcx>

§

impl<'tcx> !Send for Tables<'tcx>

§

impl<'tcx> !Sync for Tables<'tcx>

§

impl<'tcx> Unpin for Tables<'tcx>

§

impl<'tcx> !UnwindSafe for Tables<'tcx>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::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:56 bytes