diff options
author | Paul Daniel Faria <[email protected]> | 2020-06-25 02:42:44 +0100 |
---|---|---|
committer | Paul Daniel Faria <[email protected]> | 2020-06-25 14:27:00 +0100 |
commit | 0b657ddbfe9754afce9811c70a4e61e4ea9efeaf (patch) | |
tree | 9a99332d1d2fa720fbb0da6af4122a5c4d6526f7 /crates/ra_hir_def/src/nameres/tests | |
parent | 70d4829560b81e3f5dc8e624da702ed6d345c49c (diff) |
Revert resolution of all glob imports first, replace with tracking of glob imports and shadowing when more specific
Diffstat (limited to 'crates/ra_hir_def/src/nameres/tests')
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests/globs.rs | 44 |
1 files changed, 44 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 d5a02137c..7f3d7509c 100644 --- a/crates/ra_hir_def/src/nameres/tests/globs.rs +++ b/crates/ra_hir_def/src/nameres/tests/globs.rs | |||
@@ -322,3 +322,47 @@ fn glob_shadowed_def_reversed() { | |||
322 | "### | 322 | "### |
323 | ); | 323 | ); |
324 | } | 324 | } |
325 | |||
326 | #[test] | ||
327 | fn glob_shadowed_def_dependencies() { | ||
328 | let map = def_map( | ||
329 | r###" | ||
330 | //- /lib.rs | ||
331 | mod a { pub mod foo { pub struct X; } } | ||
332 | mod b { pub use super::a::foo; } | ||
333 | mod c { pub mod foo { pub struct Y; } } | ||
334 | mod d { | ||
335 | use super::c::foo; | ||
336 | use super::b::*; | ||
337 | use foo::Y; | ||
338 | } | ||
339 | "###, | ||
340 | ); | ||
341 | assert_snapshot!(map, @r###" | ||
342 | ⋮crate | ||
343 | ⋮a: t | ||
344 | ⋮b: t | ||
345 | ⋮c: t | ||
346 | ⋮d: t | ||
347 | ⋮ | ||
348 | ⋮crate::d | ||
349 | ⋮Y: t v | ||
350 | ⋮foo: t | ||
351 | ⋮ | ||
352 | ⋮crate::c | ||
353 | ⋮foo: t | ||
354 | ⋮ | ||
355 | ⋮crate::c::foo | ||
356 | ⋮Y: t v | ||
357 | ⋮ | ||
358 | ⋮crate::b | ||
359 | ⋮foo: t | ||
360 | ⋮ | ||
361 | ⋮crate::a | ||
362 | ⋮foo: t | ||
363 | ⋮ | ||
364 | ⋮crate::a::foo | ||
365 | ⋮X: t v | ||
366 | "### | ||
367 | ); | ||
368 | } | ||