Skip to main content

Scope

Struct Scope 

Source
pub struct Scope {
Show 24 fields pub parent: Option<ScopePtr>, pub children: Vec<*mut Scope>, pub bindings: HashMap<Symbol, Binding>, pub return_type: TypePackId, pub vararg_pack: Option<TypePackId>, pub level: TypeLevel, pub location: Location, pub exported_type_bindings: HashMap<Name, TypeFun>, pub private_type_bindings: HashMap<Name, TypeFun>, pub type_alias_locations: HashMap<Name, Location>, pub type_alias_name_locations: HashMap<Name, Location>, pub imported_modules: HashMap<Name, ModuleName>, pub imported_type_bindings: HashMap<Name, HashMap<Name, TypeFun>>, pub builtin_type_names: DenseHashSet<Name>, pub private_type_pack_bindings: HashMap<Name, TypePackId>, pub refinements: RefinementMap, pub lvalue_types: DenseHashMap<*const Def, TypeId>, pub rvalue_refinements: DenseHashMap<*const Def, TypeId>, pub globals_to_warn: DenseHashSet<String>, pub type_alias_type_parameters: HashMap<Name, TypeId>, pub type_alias_type_pack_parameters: HashMap<Name, TypePackId>, pub interior_free_types: Option<Vec<TypeId>>, pub interior_free_type_packs: Option<Vec<TypePackId>>, pub invalid_type_aliases: DenseHashMap<String, Location>,
}

Fields§

§parent: Option<ScopePtr>§children: Vec<*mut Scope>§bindings: HashMap<Symbol, Binding>§return_type: TypePackId§vararg_pack: Option<TypePackId>§level: TypeLevel§location: Location

the spanning location associated with this scope

§exported_type_bindings: HashMap<Name, TypeFun>§private_type_bindings: HashMap<Name, TypeFun>§type_alias_locations: HashMap<Name, Location>§type_alias_name_locations: HashMap<Name, Location>§imported_modules: HashMap<Name, ModuleName>

Mapping from the name in the require statement to the internal moduleName.

§imported_type_bindings: HashMap<Name, HashMap<Name, TypeFun>>§builtin_type_names: DenseHashSet<Name>§private_type_pack_bindings: HashMap<Name, TypePackId>§refinements: RefinementMap§lvalue_types: DenseHashMap<*const Def, TypeId>§rvalue_refinements: DenseHashMap<*const Def, TypeId>§globals_to_warn: DenseHashSet<String>§type_alias_type_parameters: HashMap<Name, TypeId>§type_alias_type_pack_parameters: HashMap<Name, TypePackId>§interior_free_types: Option<Vec<TypeId>>§interior_free_type_packs: Option<Vec<TypePackId>>§invalid_type_aliases: DenseHashMap<String, Location>

Implementations§

Source§

impl Scope

Source

pub fn add_builtin_type_binding(&mut self, name: &Name, ty_fun: &TypeFun)

Source§

impl Scope

Source

pub fn find_narrowest_scope_containing( &mut self, location: Location, ) -> *mut Scope

Source§

impl Scope

Source

pub fn inherit_assignments(&mut self, child_scope: &ScopePtr)

Source§

impl Scope

Source

pub fn inherit_refinements(&mut self, child_scope: &ScopePtr)

Source§

impl Scope

Source§

impl Scope

Source

pub fn linear_search_for_binding( &self, name: &String, traverse_scope_chain: bool, ) -> Option<Binding>

Source§

impl Scope

Source

pub fn linear_search_for_binding_pair( &self, name: &String, traverse_scope_chain: bool, ) -> Option<(Symbol, Binding)>

Source§

impl Scope

Source

pub fn lookup_ex_def_id(&mut self, def: DefId) -> Option<(TypeId, *mut Scope)>

Source§

impl Scope

Source

pub fn lookup_ex_symbol( &mut self, sym: Symbol, ) -> Option<(*mut Binding, *mut Scope)>

Source§

impl Scope

Source

pub fn lookup_imported_type( &self, module_alias: &Name, name: &Name, ) -> Option<TypeFun>

Source§

impl Scope

Source

pub fn lookup_pack(&self, name: &Name) -> Option<TypePackId>

Source§

impl Scope

Source

pub fn lookup_r_value_refinement_type(&self, def: DefId) -> Option<TypeId>

std::optional<TypeId> Scope::lookupRValueRefinementType(DefId def) const (Scope.cpp:87-96).

Source§

impl Scope

Source

pub fn lookup_symbol(&self, sym: Symbol) -> Option<TypeId>

Source§

impl Scope

Source

pub fn lookup_def_id(&self, def: DefId) -> Option<TypeId>

std::optional<TypeId> Scope::lookup(DefId def) const (Scope.cpp:98-110).

Source§

impl Scope

Source

pub fn lookup_type(&self, name: &Name) -> Option<TypeFun>

Source§

impl Scope

Source§

impl Scope

Source

pub fn new(parent: &ScopePtr, sub_level: i32) -> Self

Source§

impl Scope

Source

pub fn scope_type_pack_id(return_type: TypePackId) -> Self

Source§

impl Scope

Source

pub fn scope_scope_ptr_i32(&mut self, parent: &ScopePtr, sub_level: i32)

Source§

impl Scope

Source

pub fn should_warn_global(&self, name: String) -> bool

Trait Implementations§

Source§

impl Debug for Scope

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Send for Scope

§

impl !Sync for Scope

§

impl Freeze for Scope

§

impl RefUnwindSafe for Scope

§

impl Unpin for Scope

§

impl UnsafeUnpin for Scope

§

impl UnwindSafe for Scope

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, 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, 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.