diff options
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 1c33a6520..98c74fe25 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -462,6 +462,14 @@ impl DefCollector<'_> { | |||
462 | Some(ModuleDefId::AdtId(AdtId::EnumId(e))) => { | 462 | Some(ModuleDefId::AdtId(AdtId::EnumId(e))) => { |
463 | tested_by!(glob_enum); | 463 | tested_by!(glob_enum); |
464 | // glob import from enum => just import all the variants | 464 | // glob import from enum => just import all the variants |
465 | |||
466 | // XXX: urgh, so this works by accident! Here, we look at | ||
467 | // the enum data, and, in theory, this might require us to | ||
468 | // look back at the crate_def_map, creating a cycle. For | ||
469 | // example, `enum E { crate::some_macro!(); }`. Luckely, the | ||
470 | // only kind of macro that is allowed inside enum is a | ||
471 | // `cfg_macro`, and we don't need to run name resolution for | ||
472 | // it, but this is sheer luck! | ||
465 | let enum_data = self.db.enum_data(e); | 473 | let enum_data = self.db.enum_data(e); |
466 | let resolutions = enum_data | 474 | let resolutions = enum_data |
467 | .variants | 475 | .variants |