mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-31 00:53:48 +00:00
make a bunch of stuff private
This commit is contained in:
parent
e89700f967
commit
d30bbfda74
@ -26,8 +26,7 @@ pub use self::nameres::ModuleScope;
|
||||
pub struct Module {
|
||||
tree: Arc<ModuleTree>,
|
||||
source_root_id: SourceRootId,
|
||||
//TODO: make private
|
||||
pub module_id: ModuleId,
|
||||
module_id: ModuleId,
|
||||
}
|
||||
|
||||
impl Module {
|
||||
@ -122,7 +121,6 @@ impl Module {
|
||||
}
|
||||
|
||||
/// `name` is `None` for the crate's root module
|
||||
#[allow(unused)]
|
||||
pub fn name(&self) -> Option<SmolStr> {
|
||||
let link = self.module_id.parent_link(&self.tree)?;
|
||||
Some(link.name(&self.tree))
|
||||
@ -218,7 +216,7 @@ pub enum ModuleSource {
|
||||
|
||||
/// An owned syntax node for a module. Unlike `ModuleSource`,
|
||||
/// this holds onto the AST for the whole file.
|
||||
pub enum ModuleSourceNode {
|
||||
pub(crate) enum ModuleSourceNode {
|
||||
SourceFile(ast::SourceFileNode),
|
||||
Module(ast::ModuleNode),
|
||||
}
|
||||
@ -338,7 +336,7 @@ impl ModuleSource {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn resolve(self, db: &impl HirDatabase) -> ModuleSourceNode {
|
||||
pub(crate) fn resolve(self, db: &impl HirDatabase) -> ModuleSourceNode {
|
||||
match self {
|
||||
ModuleSource::SourceFile(file_id) => {
|
||||
let syntax = db.source_file(file_id);
|
||||
|
@ -44,7 +44,7 @@ pub struct ItemMap {
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq, Clone)]
|
||||
pub struct ModuleScope {
|
||||
pub items: FxHashMap<SmolStr, Resolution>,
|
||||
items: FxHashMap<SmolStr, Resolution>,
|
||||
}
|
||||
|
||||
impl ModuleScope {
|
||||
@ -200,11 +200,11 @@ impl ModuleItem {
|
||||
}
|
||||
|
||||
pub(crate) struct Resolver<'a, DB> {
|
||||
pub db: &'a DB,
|
||||
pub input: &'a FxHashMap<ModuleId, Arc<InputModuleItems>>,
|
||||
pub source_root: SourceRootId,
|
||||
pub module_tree: Arc<ModuleTree>,
|
||||
pub result: ItemMap,
|
||||
pub(crate) db: &'a DB,
|
||||
pub(crate) input: &'a FxHashMap<ModuleId, Arc<InputModuleItems>>,
|
||||
pub(crate) source_root: SourceRootId,
|
||||
pub(crate) module_tree: Arc<ModuleTree>,
|
||||
pub(crate) result: ItemMap,
|
||||
}
|
||||
|
||||
impl<'a, DB> Resolver<'a, DB>
|
||||
|
Loading…
Reference in New Issue
Block a user