pub trait Context {
    // Required methods
    fn entry_fn(&mut self) -> Option<CrateItem>;
    fn all_local_items(&mut self) -> CrateItems;
    fn mir_body(&mut self, item: &CrateItem) -> Body;
    fn local_crate(&self) -> Crate;
    fn external_crates(&self) -> Vec<Crate>;
    fn find_crate(&self, name: &str) -> Option<Crate>;
    fn ty_kind(&mut self, ty: Ty) -> TyKind;
    fn rustc_tables(&mut self, f: &mut dyn FnMut(&mut Tables<'_>));
}

Required Methods§

source

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

source

fn all_local_items(&mut self) -> CrateItems

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

source

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

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 ty_kind(&mut self, ty: Ty) -> TyKind

Obtain the representation of a type.

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.

Implementors§

source§

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