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