From 6a4cf48bffb739c3657443ae308fc0c91215d4d3 Mon Sep 17 00:00:00 2001 From: gfreezy Date: Fri, 20 Sep 2019 23:20:43 +0800 Subject: fix module attr path --- crates/ra_hir/src/nameres/tests/mod_resolution.rs | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'crates/ra_hir/src/nameres/tests') diff --git a/crates/ra_hir/src/nameres/tests/mod_resolution.rs b/crates/ra_hir/src/nameres/tests/mod_resolution.rs index 4f8398460..e3e6f1e95 100644 --- a/crates/ra_hir/src/nameres/tests/mod_resolution.rs +++ b/crates/ra_hir/src/nameres/tests/mod_resolution.rs @@ -706,3 +706,34 @@ fn unresolved_module_diagnostics() { "### ); } + +#[test] +fn module_resolution_decl_inside_module_in_non_crate_root_2() { + let map = def_map_with_crate_graph( + r###" + //- /main.rs + #[path="module/m2.rs"] + mod module; + + //- /module/m2.rs + pub mod submod; + + //- /module/submod.rs + pub struct Baz; + "###, + crate_graph! { + "main": ("/main.rs", []), + }, + ); + + assert_snapshot!(map, @r###" + ⋮crate + ⋮module: t + ⋮ + ⋮crate::module + ⋮submod: t + ⋮ + ⋮crate::module::submod + ⋮Baz: t v + "###); +} -- cgit v1.2.3