pub struct LoweringContext<'a, 'db> {
    pub encapsulating_ctx: Option<&'a mut EncapsulatingLoweringContext<'db>>,
    pub variables: VariableAllocator<'db>,
    pub signature: Signature,
    pub function_id: FunctionWithBodyId,
    pub concrete_function_id: ConcreteFunctionWithBodyId,
    pub current_loop_expr: Option<ExprLoop>,
    pub diagnostics: LoweringDiagnostics,
    pub blocks: FlatBlocksBuilder,
}

Fields§

§encapsulating_ctx: Option<&'a mut EncapsulatingLoweringContext<'db>>§variables: VariableAllocator<'db>

Variable allocator.

§signature: Signature

Current function signature.

§function_id: FunctionWithBodyId

Id for the current function being lowered.

§concrete_function_id: ConcreteFunctionWithBodyId

Id for the current concrete function to be used when generating recursive calls. This it the generic function specialized with its own generic parameters.

§current_loop_expr: Option<ExprLoop>

Current loop expression needed for recursive calls in continue

§diagnostics: LoweringDiagnostics

Current emitted diagnostics.

§blocks: FlatBlocksBuilder

Lowered blocks of the function.

Implementations§

source§

impl<'a, 'db> LoweringContext<'a, 'db>

source

pub fn new( global_ctx: &'a mut EncapsulatingLoweringContext<'db>, function_id: FunctionWithBodyId, signature: Signature ) -> Maybe<Self>where 'db: 'a,

source§

impl<'a, 'db> LoweringContext<'a, 'db>

source

pub fn new_var(&mut self, req: VarRequest) -> VariableId

Allocates a new variable in the context’s variable arena according to the context.

source

pub fn new_var_usage(&mut self, req: VarRequest) -> VarUsage

Same as new_var but returns it as a VarUsage. This is useful when the variable definition and usage locations are the same.

source

pub fn get_location(&self, stable_ptr: SyntaxStablePtrId) -> LocationId

Retrieves the LocationId of a stable syntax pointer in the current function file.

Trait Implementations§

source§

impl<'a, 'db> Deref for LoweringContext<'a, 'db>

§

type Target = EncapsulatingLoweringContext<'db>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, 'db> DerefMut for LoweringContext<'a, 'db>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, 'db> !RefUnwindSafe for LoweringContext<'a, 'db>

§

impl<'a, 'db> !Send for LoweringContext<'a, 'db>

§

impl<'a, 'db> !Sync for LoweringContext<'a, 'db>

§

impl<'a, 'db> Unpin for LoweringContext<'a, 'db>

§

impl<'a, 'db> !UnwindSafe for LoweringContext<'a, 'db>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T0, T1, E, TRewriter> SemanticRewriter<(T0, T1), E> for TRewriterwhere TRewriter: SemanticRewriter<T0, E> + SemanticRewriter<T1, E>,

source§

fn rewrite(&mut self, value: (T0, T1)) -> Result<(T0, T1), E>

source§

impl<T, E, TRewriter> SemanticRewriter<Box<T, Global>, E> for TRewriterwhere T: Clone, TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Box<T, Global>) -> Result<Box<T, Global>, E>

source§

impl<K, V, E, TRewriter> SemanticRewriter<HashMap<K, V, RandomState>, E> for TRewriterwhere K: Eq + Hash, TRewriter: SemanticRewriter<K, E> + SemanticRewriter<V, E>,

source§

fn rewrite( &mut self, value: HashMap<K, V, RandomState> ) -> Result<HashMap<K, V, RandomState>, E>

source§

impl<T, E, TRewriter> SemanticRewriter<Option<T>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Option<T>) -> Result<Option<T>, E>

source§

impl<T, E, TRewriter, E2> SemanticRewriter<Result<T, E2>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Result<T, E2>) -> Result<Result<T, E2>, E>

source§

impl<T, E, TRewriter> SemanticRewriter<Vec<T, Global>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Vec<T, Global>) -> Result<Vec<T, Global>, E>

source§

impl<T, E, TRewriter> SemanticRewriter<VecDeque<T, Global>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite( &mut self, value: VecDeque<T, Global> ) -> Result<VecDeque<T, Global>, E>

source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.
source§

impl<T> Upcast<T> for Twhere T: ?Sized,

source§

fn upcast(&self) -> &T

source§

impl<T> UpcastMut<T> for Twhere T: ?Sized,

source§

fn upcast_mut(&mut self) -> &mut T