diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-01 13:36:44 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-01 13:36:44 +0000 |
commit | ea67e2346e64a1a14206e6d0f163c6c2e19d0afb (patch) | |
tree | 80a4f5c9b04008df8502ed75b230661fb9041742 /crates/ra_hir_def/src/nameres/tests.rs | |
parent | 6db2da4993d3956fc7c8ebf152963a132611426a (diff) | |
parent | 0057d1e10d1bc94557e94e551079be0c9c281d3f (diff) |
Merge #3384
3384: fix #2377 super::super::* r=flodiebold a=JoshMcguigan
Thanks @matklad for the detailed explanation on #2377. I believe this fixes it.
One thing I'm not sure about is you said the fix would involve changing `crates/ra_hir_def/src/path/lower/lower.rs`, but I only changed `crates/ra_hir_def/src/path/lower/lower_use.rs`. I'm not sure what kind of test code I'd have to write to expose the issue in `lower.rs`, but I'd be happy to add it if you are able to provide additional guidance.
closes #2377
Co-authored-by: Josh Mcguigan <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres/tests.rs')
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/nameres/tests.rs b/crates/ra_hir_def/src/nameres/tests.rs index 82f0f835c..dda5ed699 100644 --- a/crates/ra_hir_def/src/nameres/tests.rs +++ b/crates/ra_hir_def/src/nameres/tests.rs | |||
@@ -66,6 +66,42 @@ fn crate_def_map_smoke_test() { | |||
66 | } | 66 | } |
67 | 67 | ||
68 | #[test] | 68 | #[test] |
69 | fn crate_def_map_super_super() { | ||
70 | let map = def_map( | ||
71 | " | ||
72 | //- /lib.rs | ||
73 | mod a { | ||
74 | const A: usize = 0; | ||
75 | |||
76 | mod b { | ||
77 | const B: usize = 0; | ||
78 | |||
79 | mod c { | ||
80 | use super::super::*; | ||
81 | } | ||
82 | } | ||
83 | } | ||
84 | ", | ||
85 | ); | ||
86 | assert_snapshot!(map, @r###" | ||
87 | ⋮crate | ||
88 | ⋮a: t | ||
89 | ⋮ | ||
90 | ⋮crate::a | ||
91 | ⋮A: v | ||
92 | ⋮b: t | ||
93 | ⋮ | ||
94 | ⋮crate::a::b | ||
95 | ⋮B: v | ||
96 | ⋮c: t | ||
97 | ⋮ | ||
98 | ⋮crate::a::b::c | ||
99 | ⋮A: v | ||
100 | ⋮b: t | ||
101 | "###) | ||
102 | } | ||
103 | |||
104 | #[test] | ||
69 | fn bogus_paths() { | 105 | fn bogus_paths() { |
70 | covers!(bogus_paths); | 106 | covers!(bogus_paths); |
71 | let map = def_map( | 107 | let map = def_map( |