@@ -635,24 +635,24 @@ impl<'a> Resolver<'a> {
635
635
// but metadata cannot encode gensyms currently, so we create it here.
636
636
// This is only a guess, two equivalent idents may incorrectly get different gensyms here.
637
637
let ident = ident. gensym_if_underscore ( ) ;
638
- let def_id = def. def_id ( ) ;
639
638
let expansion = Mark :: root ( ) ; // FIXME(jseyfried) intercrate hygiene
640
639
match def {
641
- Def :: Mod ( .. ) | Def :: Enum ( .. ) => {
640
+ Def :: Mod ( def_id ) | Def :: Enum ( def_id ) => {
642
641
let module = self . new_module ( parent,
643
642
ModuleKind :: Def ( def, ident. name ) ,
644
643
def_id,
645
644
expansion,
646
645
span) ;
647
646
self . define ( parent, ident, TypeNS , ( module, vis, DUMMY_SP , expansion) ) ;
648
647
}
649
- Def :: Variant ( ..) | Def :: TyAlias ( ..) | Def :: ForeignTy ( ..) => {
648
+ Def :: Variant ( ..) | Def :: TyAlias ( ..) | Def :: ForeignTy ( ..) | Def :: Existential ( ..) |
649
+ Def :: TraitAlias ( ..) | Def :: PrimTy ( ..) | Def :: ToolMod => {
650
650
self . define ( parent, ident, TypeNS , ( def, vis, DUMMY_SP , expansion) ) ;
651
651
}
652
652
Def :: Fn ( ..) | Def :: Static ( ..) | Def :: Const ( ..) | Def :: VariantCtor ( ..) => {
653
653
self . define ( parent, ident, ValueNS , ( def, vis, DUMMY_SP , expansion) ) ;
654
654
}
655
- Def :: StructCtor ( ..) => {
655
+ Def :: StructCtor ( def_id , ..) => {
656
656
self . define ( parent, ident, ValueNS , ( def, vis, DUMMY_SP , expansion) ) ;
657
657
658
658
if let Some ( struct_def_id) =
@@ -661,7 +661,7 @@ impl<'a> Resolver<'a> {
661
661
self . struct_constructors . insert ( struct_def_id, ( def, vis) ) ;
662
662
}
663
663
}
664
- Def :: Trait ( .. ) => {
664
+ Def :: Trait ( def_id ) => {
665
665
let module_kind = ModuleKind :: Def ( def, ident. name ) ;
666
666
let module = self . new_module ( parent,
667
667
module_kind,
@@ -682,18 +682,14 @@ impl<'a> Resolver<'a> {
682
682
}
683
683
module. populated . set ( true ) ;
684
684
}
685
- Def :: Existential ( ..) |
686
- Def :: TraitAlias ( ..) => {
687
- self . define ( parent, ident, TypeNS , ( def, vis, DUMMY_SP , expansion) ) ;
688
- }
689
- Def :: Struct ( ..) | Def :: Union ( ..) => {
685
+ Def :: Struct ( def_id) | Def :: Union ( def_id) => {
690
686
self . define ( parent, ident, TypeNS , ( def, vis, DUMMY_SP , expansion) ) ;
691
687
692
688
// Record field names for error reporting.
693
689
let field_names = self . cstore . struct_field_names_untracked ( def_id) ;
694
690
self . insert_field_names ( def_id, field_names) ;
695
691
}
696
- Def :: Macro ( ..) => {
692
+ Def :: Macro ( ..) | Def :: NonMacroAttr ( .. ) => {
697
693
self . define ( parent, ident, MacroNS , ( def, vis, DUMMY_SP , expansion) ) ;
698
694
}
699
695
_ => bug ! ( "unexpected definition: {:?}" , def)
0 commit comments