pub enum ScopeKind {
Module(Identifier),
Function,
Root,
TypeConstructor,
ExpressionWithBindings,
}
Expand description
Not used in the compiler heavily yet, but extremely useful for understanding what kind of scope you are in.
Variants§
Module(Identifier)
A module scope. This is the top level scope for a module.
Function
A function scope. This is the scope of a function body. Notably, function scopes are where all the function parameters are declared.
Root
The root scope of the user code. There is only ever one ScopeKind::Root in a compilation. All scopes are descendents of the root.
TypeConstructor
This might not be needed – the scope within a type constructor function.
ExpressionWithBindings
For a let… expression, this is the scope of the expression and its bindings.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScopeKind
impl RefUnwindSafe for ScopeKind
impl Send for ScopeKind
impl Sync for ScopeKind
impl Unpin for ScopeKind
impl UnwindSafe for ScopeKind
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