mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-21 20:23:21 +00:00
Merge #7013
7013: Don't think that /submod.rs is /mod.rs r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
5e005cd91e
@ -91,18 +91,18 @@ mod tests;
|
||||
extract_module_to_file,
|
||||
r#"
|
||||
//- /main.rs
|
||||
mod submodule;
|
||||
//- /submodule.rs
|
||||
mod submod;
|
||||
//- /submod.rs
|
||||
mod inner<|> {
|
||||
fn f() {}
|
||||
}
|
||||
fn g() {}
|
||||
"#,
|
||||
r#"
|
||||
//- /submodule.rs
|
||||
//- /submod.rs
|
||||
mod inner;
|
||||
fn g() {}
|
||||
//- /submodule/inner.rs
|
||||
//- /submod/inner.rs
|
||||
fn f() {}
|
||||
"#,
|
||||
);
|
||||
|
@ -79,7 +79,7 @@ impl ModDir {
|
||||
for candidate in candidate_files.iter() {
|
||||
let path = AnchoredPath { anchor: file_id, path: candidate.as_str() };
|
||||
if let Some(file_id) = db.resolve_path(path) {
|
||||
let is_mod_rs = candidate.ends_with("mod.rs");
|
||||
let is_mod_rs = candidate.ends_with("/mod.rs");
|
||||
|
||||
let (dir_path, root_non_dir_owner) = if is_mod_rs || attr_path.is_some() {
|
||||
(DirPath::empty(), false)
|
||||
|
Loading…
Reference in New Issue
Block a user