mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Rename ModuleScope -> ItemScope
This commit is contained in:
parent
16ac792f48
commit
2ce1aa32c4
@ -8,7 +8,7 @@ use rustc_hash::FxHashMap;
|
|||||||
use crate::{per_ns::PerNs, BuiltinType, LocalImportId, MacroDefId, ModuleDefId, TraitId};
|
use crate::{per_ns::PerNs, BuiltinType, LocalImportId, MacroDefId, ModuleDefId, TraitId};
|
||||||
|
|
||||||
#[derive(Debug, Default, PartialEq, Eq)]
|
#[derive(Debug, Default, PartialEq, Eq)]
|
||||||
pub struct ModuleScope {
|
pub struct ItemScope {
|
||||||
pub(crate) items: FxHashMap<Name, Resolution>,
|
pub(crate) items: FxHashMap<Name, Resolution>,
|
||||||
/// Macros visible in current module in legacy textual scope
|
/// 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`.
|
/// 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.
|
/// 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 {
|
pub fn entries<'a>(&'a self) -> impl Iterator<Item = (&'a Name, &'a Resolution)> + 'a {
|
||||||
//FIXME: shadowing
|
//FIXME: shadowing
|
||||||
self.items.iter().chain(BUILTIN_SCOPE.iter())
|
self.items.iter().chain(BUILTIN_SCOPE.iter())
|
||||||
|
@ -69,7 +69,7 @@ use rustc_hash::FxHashMap;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::DefDatabase,
|
db::DefDatabase,
|
||||||
item_scope::{BuiltinShadowMode, ModuleScope},
|
item_scope::{BuiltinShadowMode, ItemScope},
|
||||||
nameres::{diagnostics::DefDiagnostic, path_resolution::ResolveMode},
|
nameres::{diagnostics::DefDiagnostic, path_resolution::ResolveMode},
|
||||||
path::ModPath,
|
path::ModPath,
|
||||||
per_ns::PerNs,
|
per_ns::PerNs,
|
||||||
@ -165,7 +165,7 @@ impl ModuleOrigin {
|
|||||||
pub struct ModuleData {
|
pub struct ModuleData {
|
||||||
pub parent: Option<LocalModuleId>,
|
pub parent: Option<LocalModuleId>,
|
||||||
pub children: FxHashMap<Name, LocalModuleId>,
|
pub children: FxHashMap<Name, LocalModuleId>,
|
||||||
pub scope: ModuleScope,
|
pub scope: ItemScope,
|
||||||
|
|
||||||
/// Where does this module come from?
|
/// Where does this module come from?
|
||||||
pub origin: ModuleOrigin,
|
pub origin: ModuleOrigin,
|
||||||
|
Loading…
Reference in New Issue
Block a user