aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/tests
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-20 16:45:58 +0100
committerGitHub <[email protected]>2019-09-20 16:45:58 +0100
commit0492b18ed47115c630cf3490fcdf904155f6e496 (patch)
tree534255fd111da9af89ebe19a8f6df886783155b1 /crates/ra_hir/src/nameres/tests
parent24ac228c395681e600b0a7034bd332458af9ce8c (diff)
parent6a4cf48bffb739c3657443ae308fc0c91215d4d3 (diff)
Merge #1883
1883: Fix path attribute causing false "unresolved module" error for submodules r=matklad a=gfreezy fixed #1880 Co-authored-by: gfreezy <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/nameres/tests')
-rw-r--r--crates/ra_hir/src/nameres/tests/mod_resolution.rs31
1 files changed, 31 insertions, 0 deletions
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() {
706 "### 706 "###
707 ); 707 );
708} 708}
709
710#[test]
711fn module_resolution_decl_inside_module_in_non_crate_root_2() {
712 let map = def_map_with_crate_graph(
713 r###"
714 //- /main.rs
715 #[path="module/m2.rs"]
716 mod module;
717
718 //- /module/m2.rs
719 pub mod submod;
720
721 //- /module/submod.rs
722 pub struct Baz;
723 "###,
724 crate_graph! {
725 "main": ("/main.rs", []),
726 },
727 );
728
729 assert_snapshot!(map, @r###"
730 ⋮crate
731 ⋮module: t
732
733 ⋮crate::module
734 ⋮submod: t
735
736 ⋮crate::module::submod
737 ⋮Baz: t v
738 "###);
739}