pub struct CompilerRef<'c> { /* private fields */ }Expand description
A reference to the compiler.
This is only available inside the Compiler::enter closure, and has access to the global
context.
Implementations§
Source§impl<'c> CompilerRef<'c>
impl<'c> CompilerRef<'c>
Sourcepub fn dcx_mut(&mut self) -> &mut DiagCtxt
pub fn dcx_mut(&mut self) -> &mut DiagCtxt
Returns a mutable reference to the diagnostics context.
Sourcepub fn sources_mut(&mut self) -> &mut Sources<'c>
pub fn sources_mut(&mut self) -> &mut Sources<'c>
Returns a mutable reference to the sources.
Sourcepub fn drop_asts(&mut self)
pub fn drop_asts(&mut self)
Drops the sources, ASTs, and AST arenas in a separate thread.
This is not done by default in the pipeline, but it can be called after lower_asts to
free up memory.
Sourcepub fn parse(&mut self) -> ParsingContext<'c>
pub fn parse(&mut self) -> ParsingContext<'c>
Returns a builder for parsing sources.
ParsingContext::parse must be called at the end to actually parse
the sources.
Sourcepub fn lower_asts(&mut self) -> Result<ControlFlow<()>, ErrorGuaranteed>
pub fn lower_asts(&mut self) -> Result<ControlFlow<()>, ErrorGuaranteed>
Performs AST lowering.
Lowers the entire program to HIR, populating gcx.hir.
pub fn analysis(&self) -> Result<ControlFlow<()>, ErrorGuaranteed>
Trait Implementations§
Auto Trait Implementations§
impl<'c> !Freeze for CompilerRef<'c>
impl<'c> !RefUnwindSafe for CompilerRef<'c>
impl<'c> Send for CompilerRef<'c>
impl<'c> Sync for CompilerRef<'c>
impl<'c> !Unpin for CompilerRef<'c>
impl<'c> !UnwindSafe for CompilerRef<'c>
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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