diff options
Diffstat (limited to 'crates/ra_hir_def/src/path/lower')
-rw-r--r-- | crates/ra_hir_def/src/path/lower/lower_use.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs index 062c02063..3218eaf0a 100644 --- a/crates/ra_hir_def/src/path/lower/lower_use.rs +++ b/crates/ra_hir_def/src/path/lower/lower_use.rs | |||
@@ -9,6 +9,7 @@ use hir_expand::{ | |||
9 | name::{AsName, Name}, | 9 | name::{AsName, Name}, |
10 | }; | 10 | }; |
11 | use ra_syntax::ast::{self, NameOwner}; | 11 | use ra_syntax::ast::{self, NameOwner}; |
12 | use test_utils::tested_by; | ||
12 | 13 | ||
13 | use crate::path::{ModPath, PathKind}; | 14 | use crate::path::{ModPath, PathKind}; |
14 | 15 | ||
@@ -34,6 +35,7 @@ pub(crate) fn lower_use_tree( | |||
34 | } | 35 | } |
35 | } else { | 36 | } else { |
36 | let alias = tree.alias().and_then(|a| a.name()).map(|a| a.as_name()); | 37 | let alias = tree.alias().and_then(|a| a.name()).map(|a| a.as_name()); |
38 | let is_glob = tree.has_star(); | ||
37 | if let Some(ast_path) = tree.path() { | 39 | if let Some(ast_path) = tree.path() { |
38 | // Handle self in a path. | 40 | // Handle self in a path. |
39 | // E.g. `use something::{self, <...>}` | 41 | // E.g. `use something::{self, <...>}` |
@@ -48,11 +50,15 @@ pub(crate) fn lower_use_tree( | |||
48 | } | 50 | } |
49 | } | 51 | } |
50 | if let Some(path) = convert_path(prefix, ast_path, hygiene) { | 52 | if let Some(path) = convert_path(prefix, ast_path, hygiene) { |
51 | let is_glob = tree.has_star(); | ||
52 | cb(path, &tree, is_glob, alias) | 53 | cb(path, &tree, is_glob, alias) |
53 | } | 54 | } |
54 | // FIXME: report errors somewhere | 55 | // FIXME: report errors somewhere |
55 | // We get here if we do | 56 | // We get here if we do |
57 | } else if is_glob { | ||
58 | tested_by!(glob_enum_group); | ||
59 | if let Some(prefix) = prefix { | ||
60 | cb(prefix, &tree, is_glob, None) | ||
61 | } | ||
56 | } | 62 | } |
57 | } | 63 | } |
58 | } | 64 | } |