Struct rustc_smir::rustc_smir::Tables
source · pub struct Tables<'tcx> {
pub tcx: TyCtxt<'tcx>,
pub def_ids: Vec<DefId>,
pub alloc_ids: Vec<AllocId>,
pub spans: Vec<Span>,
pub types: Vec<MaybeStable<TyKind, Ty<'tcx>>>,
}Fields§
§tcx: TyCtxt<'tcx>§def_ids: Vec<DefId>§alloc_ids: Vec<AllocId>§spans: Vec<Span>§types: Vec<MaybeStable<TyKind, Ty<'tcx>>>Implementations§
source§impl<'tcx> Tables<'tcx>
impl<'tcx> Tables<'tcx>
pub fn crate_item(&mut self, did: DefId) -> CrateItem
pub fn adt_def(&mut self, did: DefId) -> AdtDef
pub fn foreign_def(&mut self, did: DefId) -> ForeignDef
pub fn fn_def(&mut self, did: DefId) -> FnDef
pub fn closure_def(&mut self, did: DefId) -> ClosureDef
pub fn generator_def(&mut self, did: DefId) -> GeneratorDef
pub fn alias_def(&mut self, did: DefId) -> AliasDef
pub fn param_def(&mut self, did: DefId) -> ParamDef
pub fn br_named_def(&mut self, did: DefId) -> BrNamedDef
pub fn trait_def(&mut self, did: DefId) -> TraitDef
pub fn generic_def(&mut self, did: DefId) -> GenericDef
pub fn const_def(&mut self, did: DefId) -> ConstDef
pub fn impl_def(&mut self, did: DefId) -> ImplDef
pub fn prov(&mut self, aid: AllocId) -> Prov
fn create_def_id(&mut self, did: DefId) -> DefId
fn create_alloc_id(&mut self, aid: AllocId) -> AllocId
pub(crate) fn create_span(&mut self, span: Span) -> Span
Trait Implementations§
source§impl<'tcx> Context for Tables<'tcx>
impl<'tcx> Context for Tables<'tcx>
source§fn local_crate(&self) -> Crate
fn local_crate(&self) -> Crate
Get information about the local crate.
source§fn external_crates(&self) -> Vec<Crate>
fn external_crates(&self) -> Vec<Crate>
Retrieve a list of all external crates.
source§fn name_of_def_id(&self, def_id: DefId) -> String
fn name_of_def_id(&self, def_id: DefId) -> String
Prints the name of given
DefIdsource§fn span_of_an_item(&mut self, def_id: DefId) -> Span
fn span_of_an_item(&mut self, def_id: DefId) -> Span
Span of an itemsource§fn all_local_items(&mut self) -> CrateItems
fn all_local_items(&mut self) -> CrateItems
Retrieve all items of the local crate that have a MIR associated with them.
fn entry_fn(&mut self) -> Option<CrateItem>
fn all_trait_decls(&mut self) -> TraitDecls
fn trait_decl(&mut self, trait_def: &TraitDef) -> TraitDecl
fn all_trait_impls(&mut self) -> ImplTraitDecls
fn trait_impl(&mut self, impl_def: &ImplDef) -> ImplTrait
fn mir_body(&mut self, item: DefId) -> Body
source§fn rustc_tables(&mut self, f: &mut dyn FnMut(&mut Tables<'_>))
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 mk_ty(&mut self, kind: TyKind) -> Ty
fn mk_ty(&mut self, kind: TyKind) -> Ty
Create a new
Ty from scratch without information from rustc.fn generics_of(&mut self, def_id: DefId) -> Generics
fn predicates_of(&mut self, def_id: DefId) -> GenericPredicates
fn explicit_predicates_of(&mut self, def_id: DefId) -> GenericPredicates
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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