pub struct Tables<'tcx> {
    pub(crate) tcx: TyCtxt<'tcx>,
    pub(crate) def_ids: IndexMap<DefId, DefId>,
    pub(crate) alloc_ids: IndexMap<AllocId, AllocId>,
    pub(crate) spans: IndexMap<Span, Span>,
    pub(crate) types: IndexMap<Ty<'tcx>, Ty>,
    pub(crate) instances: IndexMap<Instance<'tcx>, InstanceDef>,
    pub(crate) constants: IndexMap<Const<'tcx>, ConstId>,
    pub(crate) layouts: IndexMap<Layout<'tcx>, Layout>,
}

Fields§

§tcx: TyCtxt<'tcx>§def_ids: IndexMap<DefId, DefId>§alloc_ids: IndexMap<AllocId, AllocId>§spans: IndexMap<Span, Span>§types: IndexMap<Ty<'tcx>, Ty>§instances: IndexMap<Instance<'tcx>, InstanceDef>§constants: IndexMap<Const<'tcx>, ConstId>§layouts: IndexMap<Layout<'tcx>, Layout>

Implementations§

source§

impl<'tcx> Tables<'tcx>

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 coroutine_def(&mut self, did: DefId) -> CoroutineDef

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

pub fn generic_def(&mut self, did: DefId) -> GenericDef

source

pub fn const_def(&mut self, did: DefId) -> ConstDef

source

pub fn impl_def(&mut self, did: DefId) -> ImplDef

source

pub fn region_def(&mut self, did: DefId) -> RegionDef

source

pub fn coroutine_witness_def(&mut self, did: DefId) -> CoroutineWitnessDef

source

pub fn prov(&mut self, aid: AllocId) -> Prov

source

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

source

pub(crate) fn create_alloc_id(&mut self, aid: AllocId) -> AllocId

source

pub(crate) fn create_span(&mut self, span: Span) -> Span

source

pub(crate) fn instance_def(&mut self, instance: Instance<'tcx>) -> InstanceDef

source

pub(crate) fn static_def(&mut self, did: DefId) -> StaticDef

source

pub(crate) fn layout_id(&mut self, layout: Layout<'tcx>) -> Layout

source§

impl<'tcx> Tables<'tcx>

source

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

source

pub(crate) fn intern_const(&mut self, constant: Const<'tcx>) -> ConstId

source

pub(crate) fn has_body(&self, instance: Instance<'tcx>) -> bool

Trait Implementations§

source§

impl<'tcx> FnAbiOfHelpers<'tcx> for Tables<'tcx>

Implement error handling for extracting function ABI information.

§

type FnAbiOfResult = Result<&'tcx FnAbi<'tcx, Ty<'tcx>>, Error>

The &FnAbi-wrapping type (or &FnAbi itself), which will be returned from fn_abi_of_* (see also handle_fn_abi_err).
source§

fn handle_fn_abi_err( &self, err: FnAbiError<'tcx>, _span: Span, fn_abi_request: FnAbiRequest<'tcx> ) -> Error

Helper used for fn_abi_of_*, to adapt tcx.fn_abi_of_*(...) into a Self::FnAbiOfResult (which does not need to be a Result<...>). Read more
source§

impl<'tcx> HasDataLayout for Tables<'tcx>

source§

impl<'tcx> HasParamEnv<'tcx> for Tables<'tcx>

source§

fn param_env(&self) -> ParamEnv<'tcx>

source§

impl<'tcx> HasTyCtxt<'tcx> for Tables<'tcx>

source§

fn tcx(&self) -> TyCtxt<'tcx>

source§

impl<'tcx> Index<DefId> for Tables<'tcx>

§

type Output = DefId

The returned type after indexing.
source§

fn index(&self, index: DefId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'tcx> Index<Span> for Tables<'tcx>

§

type Output = Span

The returned type after indexing.
source§

fn index(&self, index: Span) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'tcx> LayoutOfHelpers<'tcx> for Tables<'tcx>

§

type LayoutOfResult = Result<TyAndLayout<'tcx, Ty<'tcx>>, Error>

The TyAndLayout-wrapping type (or TyAndLayout itself), which will be returned from layout_of (see also handle_layout_err).
source§

fn handle_layout_err( &self, err: LayoutError<'tcx>, _span: Span, ty: Ty<'tcx> ) -> Error

Helper used for layout_of, to adapt tcx.layout_of(...) into a Self::LayoutOfResult (which does not need to be a Result<...>). Read more
source§

fn layout_tcx_at_span(&self) -> Span

Span to use for tcx.at(span), from layout_of.

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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: 400 bytes