Rename ModuleScope -> ItemScope

This commit is contained in:
Aleksey Kladov 2019-12-20 15:45:12 +01:00
parent 16ac792f48
commit 2ce1aa32c4
2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ use rustc_hash::FxHashMap;
use crate::{per_ns::PerNs, BuiltinType, LocalImportId, MacroDefId, ModuleDefId, TraitId};
#[derive(Debug, Default, PartialEq, Eq)]
pub struct ModuleScope {
pub struct ItemScope {
pub(crate) items: FxHashMap<Name, Resolution>,
/// Macros visible in current module in legacy textual scope
///
@ -45,7 +45,7 @@ pub enum BuiltinShadowMode {
/// Legacy macros can only be accessed through special methods like `get_legacy_macros`.
/// Other methods will only resolve values, types and module scoped macros only.
impl ModuleScope {
impl ItemScope {
pub fn entries<'a>(&'a self) -> impl Iterator<Item = (&'a Name, &'a Resolution)> + 'a {
//FIXME: shadowing
self.items.iter().chain(BUILTIN_SCOPE.iter())

View file

@ -69,7 +69,7 @@ use rustc_hash::FxHashMap;
use crate::{
db::DefDatabase,
item_scope::{BuiltinShadowMode, ModuleScope},
item_scope::{BuiltinShadowMode, ItemScope},
nameres::{diagnostics::DefDiagnostic, path_resolution::ResolveMode},
path::ModPath,
per_ns::PerNs,
@ -165,7 +165,7 @@ impl ModuleOrigin {
pub struct ModuleData {
pub parent: Option<LocalModuleId>,
pub children: FxHashMap<Name, LocalModuleId>,
pub scope: ModuleScope,
pub scope: ItemScope,
/// Where does this module come from?
pub origin: ModuleOrigin,