diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2022-04-02 16:14:19 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2022-04-02 16:17:54 +0200 |
| commit | 1da2d82f5825797670cc8103aaae83d34f53d021 (patch) | |
| tree | f70bce144e48595c0eb72b77e9d49000a231a273 | |
| parent | f610e2c2edfe8f3fdd0c9719e748af55093b449e (diff) | |
| download | rust-1da2d82f5825797670cc8103aaae83d34f53d021.tar.gz rust-1da2d82f5825797670cc8103aaae83d34f53d021.zip | |
internal: outline child modules with missing backing file
| -rw-r--r-- | crates/hir_def/src/nameres/collector.rs | 6 | ||||
| -rw-r--r-- | crates/hir_def/src/nameres/tests.rs | 6 | ||||
| -rw-r--r-- | crates/hir_def/src/nameres/tests/mod_resolution.rs | 3 |
3 files changed, 15 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index 14b26bcf452..15e93f729a0 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs @@ -1743,6 +1743,12 @@ impl ModCollector<'_, '_> { } } Err(candidates) => { + self.push_child_module( + module.name.clone(), + ast_id, + None, + &self.item_tree[module.visibility], + ); self.def_collector.def_map.diagnostics.push( DefDiagnostic::unresolved_module(self.module_id, ast_id, candidates), ); diff --git a/crates/hir_def/src/nameres/tests.rs b/crates/hir_def/src/nameres/tests.rs index 47949328557..80e54760714 100644 --- a/crates/hir_def/src/nameres/tests.rs +++ b/crates/hir_def/src/nameres/tests.rs @@ -375,9 +375,12 @@ pub struct Arc; "#, expect![[r#" crate + alloc: t alloc_crate: t sync: t + crate::alloc + crate::sync Arc: t v "#]], @@ -401,9 +404,12 @@ pub struct Arc; "#, expect![[r#" crate + alloc: t alloc_crate: t sync: t + crate::alloc + crate::sync Arc: t v "#]], diff --git a/crates/hir_def/src/nameres/tests/mod_resolution.rs b/crates/hir_def/src/nameres/tests/mod_resolution.rs index 16a2cd27af3..79a74873b4a 100644 --- a/crates/hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/hir_def/src/nameres/tests/mod_resolution.rs @@ -526,6 +526,9 @@ pub struct Baz; "#, expect![[r#" crate + foo: t + + crate::foo "#]], ); } |
