BinderScopes

Struct BinderScopes 

Source
pub struct BinderScopes<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> BinderScopes<'a>

Source

pub fn new(unit: CompileUnit<'a>, globals: &'a Scope<'a>) -> Self

Source

pub fn top(&self) -> &'a Scope<'a>

Source

pub fn unit(&self) -> CompileUnit<'a>

Source

pub fn interner(&self) -> &InternPool

Source

pub fn scopes(&self) -> &ScopeStack<'a>

Source

pub fn scopes_mut(&mut self) -> &mut ScopeStack<'a>

Source

pub fn scope_depth(&self) -> usize

Gets the current depth of the scope stack.

  • 0 means no scope has been pushed yet
  • 1 means global scope is active
  • 2+ means nested scopes are active
Source

pub fn push_scope(&mut self, id: ScopeId)

Pushes a scope onto the stack by looking it up from the compilation unit.

Source

pub fn push_scope_recursive(&mut self, id: ScopeId)

Pushes a scope recursively with all its parent scopes.

Source

pub fn push_scope_node(&mut self, sn: &'a HirScope<'a>)

Pushes the scope represented by a HirScope node.

Source

pub fn pop_scope(&mut self)

Pops the current scope from the stack.

Source

pub fn pop_until(&mut self, depth: usize)

Pops scopes until reaching the specified depth.

Source

pub fn globals(&self) -> &'a Scope<'a>

Gets the global scope (always at index 0).

Source

pub fn lookup_globals( &self, name: &str, kind_filters: SymKindSet, ) -> Option<Vec<&'a Symbol>>

Source

pub fn lookup_global( &self, name: &str, kind_filters: SymKindSet, ) -> Option<&'a Symbol>

Source

pub fn lookup_symbols( &self, name: &str, kind_filters: SymKindSet, ) -> Option<Vec<&'a Symbol>>

Lookup symbols by name with options

Source

pub fn lookup_symbol( &self, name: &str, kind_filters: SymKindSet, ) -> Option<&'a Symbol>

Source

pub fn lookup_member_symbols( &self, obj_type_symbol: &'a Symbol, member_name: &str, kind_filters: SymKindSet, ) -> Option<&'a Symbol>

Look up a member symbol in a type’s scope.

Source

pub fn lookup_member_symbol( &self, obj_type_symbol: &'a Symbol, member_name: &str, kind_filter: Option<SymKind>, ) -> Option<&'a Symbol>

Look up a member symbol in a type’s scope.

Source

pub fn lookup_qualified( &self, qualified_name: &[&str], kind_filters: SymKindSet, ) -> Option<Vec<&'a Symbol>>

Look up a qualified path (e.g., foo::Bar::baz) with optional kind filters.

Source

pub fn lookup_qualified_symbol( &self, qualified_name: &[&str], kind_filters: SymKindSet, ) -> Option<&'a Symbol>

Look up a qualified path and apply same-crate preference for multi-crate scenarios.

Trait Implementations§

Source§

impl<'a> Debug for BinderScopes<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for BinderScopes<'a>

§

impl<'a> !RefUnwindSafe for BinderScopes<'a>

§

impl<'a> Send for BinderScopes<'a>

§

impl<'a> Sync for BinderScopes<'a>

§

impl<'a> Unpin for BinderScopes<'a>

§

impl<'a> !UnwindSafe for BinderScopes<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more