pub(crate) struct LoweringCtxt {
    res: Resolver,
    file: File,
    errors: Vec<Error>,
}
Expand description

Context needed while lowering.

This is used to do name resolution on the topdecs during lowering.

Maybe need to also have a BodyLoweringCtxt as well, just to keep track of weird nested infix stuff? That seems like an annoying corner case…

Fields§

§res: Resolver§file: File§errors: Vec<Error>

Implementations§

This is needed because some of the dec can have recursive bindings.

For these, we need to preallocate the Dec node so we can give its index out before lowering interior pats, exprs, etc.

Register patterns in val rec declarations.

This is needed because the expression in the binding can refer to the names in pat.

Register identifiers bound in the current Dec.

Register type constructors bound in the current Dec.

Register fixities bound in the current Dec.

Register identifiers declared in the the Pat of a pattern match.

This needs to be done before lowering Expr on the RHS of the match, otherwise any names declared here will not be in scope in the Expr.

Horrible hack to make while loop lowering work…

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.