aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r--crates/ra_hir_def/src/nameres/tests/globs.rs47
1 files changed, 47 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/nameres/tests/globs.rs b/crates/ra_hir_def/src/nameres/tests/globs.rs
index 2b12c0daa..2f440975a 100644
--- a/crates/ra_hir_def/src/nameres/tests/globs.rs
+++ b/crates/ra_hir_def/src/nameres/tests/globs.rs
@@ -229,3 +229,50 @@ fn glob_enum_group() {
229 "### 229 "###
230 ); 230 );
231} 231}
232
233#[test]
234fn glob_shadowed_def() {
235 mark::check!(import_shadowed);
236 let map = def_map(
237 r###"
238 //- /lib.rs
239 mod foo;
240 mod bar;
241
242 use foo::*;
243 use bar::baz;
244
245 use baz::Bar;
246
247 //- /foo.rs
248 pub mod baz {
249 pub struct Foo;
250 }
251
252 //- /bar.rs
253 pub mod baz {
254 pub struct Bar;
255 }
256 "###,
257 );
258 assert_snapshot!(map, @r###"
259 ⋮crate
260 ⋮Bar: t v
261 ⋮bar: t
262 ⋮baz: t
263 ⋮foo: t
264
265 ⋮crate::bar
266 ⋮baz: t
267
268 ⋮crate::bar::baz
269 ⋮Bar: t v
270
271 ⋮crate::foo
272 ⋮baz: t
273
274 ⋮crate::foo::baz
275 ⋮Foo: t v
276 "###
277 );
278}