mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
Merge #2174
2174: Reduce visibility r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
7c0d7d3838
@ -50,8 +50,8 @@
|
|||||||
// FIXME: review privacy of submodules
|
// FIXME: review privacy of submodules
|
||||||
pub mod raw;
|
pub mod raw;
|
||||||
pub mod per_ns;
|
pub mod per_ns;
|
||||||
pub mod collector;
|
mod collector;
|
||||||
pub mod mod_resolution;
|
mod mod_resolution;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
@ -6,7 +6,7 @@ use ra_syntax::SmolStr;
|
|||||||
use crate::{db::DefDatabase2, HirFileId};
|
use crate::{db::DefDatabase2, HirFileId};
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct ModDir {
|
pub(super) struct ModDir {
|
||||||
/// `.` for `mod.rs`, `lib.rs`
|
/// `.` for `mod.rs`, `lib.rs`
|
||||||
/// `./foo` for `foo.rs`
|
/// `./foo` for `foo.rs`
|
||||||
/// `./foo/bar` for `mod bar { mod x; }` nested in `foo.rs`
|
/// `./foo/bar` for `mod bar { mod x; }` nested in `foo.rs`
|
||||||
@ -16,11 +16,15 @@ pub struct ModDir {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ModDir {
|
impl ModDir {
|
||||||
pub fn root() -> ModDir {
|
pub(super) fn root() -> ModDir {
|
||||||
ModDir { path: RelativePathBuf::default(), root_non_dir_owner: false }
|
ModDir { path: RelativePathBuf::default(), root_non_dir_owner: false }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn descend_into_definition(&self, name: &Name, attr_path: Option<&SmolStr>) -> ModDir {
|
pub(super) fn descend_into_definition(
|
||||||
|
&self,
|
||||||
|
name: &Name,
|
||||||
|
attr_path: Option<&SmolStr>,
|
||||||
|
) -> ModDir {
|
||||||
let mut path = self.path.clone();
|
let mut path = self.path.clone();
|
||||||
match attr_to_path(attr_path) {
|
match attr_to_path(attr_path) {
|
||||||
None => path.push(&name.to_string()),
|
None => path.push(&name.to_string()),
|
||||||
@ -34,7 +38,7 @@ impl ModDir {
|
|||||||
ModDir { path, root_non_dir_owner: false }
|
ModDir { path, root_non_dir_owner: false }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn resolve_declaration(
|
pub(super) fn resolve_declaration(
|
||||||
&self,
|
&self,
|
||||||
db: &impl DefDatabase2,
|
db: &impl DefDatabase2,
|
||||||
file_id: HirFileId,
|
file_id: HirFileId,
|
||||||
|
Loading…
Reference in New Issue
Block a user