pub struct CompileCtxt<'tcx> {Show 15 fields
pub arena: Arena<'tcx>,
pub interner: InternPool,
pub files: Vec<File>,
pub trees: Vec<Option<Tree>>,
pub hir_next_id: Cell<u32>,
pub hir_start_ids: RefCell<Vec<Option<HirId>>>,
pub hir_map: RefCell<HashMap<HirId, ParentedNode<'tcx>>>,
pub scope_map: RefCell<HashMap<HirId, &'tcx Scope<'tcx>>>,
pub symbol_map: RefCell<HashMap<SymId, &'tcx Symbol>>,
pub block_arena: Arena<'tcx>,
pub block_next_id: Cell<u32>,
pub block_map: RefCell<HashMap<BlockId, ParentedBlock<'tcx>>>,
pub unresolve_symbols: RefCell<Vec<&'tcx Symbol>>,
pub related_map: BlockRelationMap,
pub block_indexes: RefCell<BlockIndexMaps>,
}Fields§
§arena: Arena<'tcx>§interner: InternPool§files: Vec<File>§trees: Vec<Option<Tree>>§hir_next_id: Cell<u32>§hir_start_ids: RefCell<Vec<Option<HirId>>>§hir_map: RefCell<HashMap<HirId, ParentedNode<'tcx>>>§scope_map: RefCell<HashMap<HirId, &'tcx Scope<'tcx>>>§symbol_map: RefCell<HashMap<SymId, &'tcx Symbol>>§block_arena: Arena<'tcx>§block_next_id: Cell<u32>§block_map: RefCell<HashMap<BlockId, ParentedBlock<'tcx>>>§unresolve_symbols: RefCell<Vec<&'tcx Symbol>>§block_indexes: RefCell<BlockIndexMaps>Index maps for efficient block lookups by name, kind, unit, and id
Implementations§
Source§impl<'tcx> CompileCtxt<'tcx>
impl<'tcx> CompileCtxt<'tcx>
Sourcepub fn from_sources<L: LanguageTrait>(sources: &[Vec<u8>]) -> Self
pub fn from_sources<L: LanguageTrait>(sources: &[Vec<u8>]) -> Self
Create a new CompileCtxt from source code
Sourcepub fn from_files<L: LanguageTrait>(paths: &[String]) -> Result<Self>
pub fn from_files<L: LanguageTrait>(paths: &[String]) -> Result<Self>
Create a new CompileCtxt from files
Sourcepub fn from_dir<P: AsRef<Path>, L: LanguageTrait>(dir: P) -> Result<Self>
pub fn from_dir<P: AsRef<Path>, L: LanguageTrait>(dir: P) -> Result<Self>
Create a new CompileCtxt from a directory, recursively finding all *.rs files
Sourcepub fn compile_unit(&'tcx self, index: usize) -> CompileUnit<'tcx>
pub fn compile_unit(&'tcx self, index: usize) -> CompileUnit<'tcx>
Create a context that references this CompileCtxt for a specific file index
pub fn create_globals(&'tcx self) -> &'tcx Scope<'tcx>
pub fn get_scope(&'tcx self, owner: HirId) -> &'tcx Scope<'tcx>
pub fn opt_get_symbol(&'tcx self, owner: SymId) -> Option<&'tcx Symbol>
Sourcepub fn find_symbol_by_block_id(
&'tcx self,
block_id: BlockId,
) -> Option<&'tcx Symbol>
pub fn find_symbol_by_block_id( &'tcx self, block_id: BlockId, ) -> Option<&'tcx Symbol>
Find the primary symbol associated with a block ID
pub fn alloc_scope(&'tcx self, owner: HirId) -> &'tcx Scope<'tcx>
pub fn reserve_hir_id(&self) -> HirId
pub fn reserve_block_id(&self) -> BlockId
pub fn current_hir_id(&self) -> HirId
pub fn set_file_start(&self, index: usize, start: HirId)
pub fn file_start(&self, index: usize) -> Option<HirId>
pub fn file_path(&self, index: usize) -> Option<&str>
Trait Implementations§
Source§impl<'tcx> Debug for CompileCtxt<'tcx>
impl<'tcx> Debug for CompileCtxt<'tcx>
Source§impl<'tcx> Default for CompileCtxt<'tcx>
impl<'tcx> Default for CompileCtxt<'tcx>
Source§fn default() -> CompileCtxt<'tcx>
fn default() -> CompileCtxt<'tcx>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'tcx> !Freeze for CompileCtxt<'tcx>
impl<'tcx> !RefUnwindSafe for CompileCtxt<'tcx>
impl<'tcx> !Send for CompileCtxt<'tcx>
impl<'tcx> !Sync for CompileCtxt<'tcx>
impl<'tcx> Unpin for CompileCtxt<'tcx>
impl<'tcx> !UnwindSafe for CompileCtxt<'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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more