@@ -14,7 +14,8 @@ use rustc_data_structures::fx::FxHashSet;
1414use rustc_data_structures:: ptr_key:: PtrKey ;
1515use rustc_data_structures:: sync:: Lrc ;
1616use rustc_errors:: struct_span_err;
17- use rustc_expand:: base:: { Indeterminate , InvocationRes , ResolverExpand , SyntaxExtension } ;
17+ use rustc_expand:: base:: { Indeterminate , InvocationRes , ResolverExpand } ;
18+ use rustc_expand:: base:: { SyntaxExtension , SyntaxExtensionKind } ;
1819use rustc_expand:: compile_declarative_macro;
1920use rustc_expand:: expand:: { AstFragment , Invocation , InvocationKind } ;
2021use rustc_feature:: is_builtin_attr_name;
@@ -176,10 +177,11 @@ impl<'a> ResolverExpand for Resolver<'a> {
176177 parent_scope. module . unexpanded_invocations . borrow_mut ( ) . remove ( & expansion) ;
177178 }
178179
179- fn register_builtin_macro ( & mut self , ident : Ident , ext : SyntaxExtension ) {
180- if self . builtin_macros . insert ( ident . name , BuiltinMacroState :: NotYetSeen ( ext) ) . is_some ( ) {
180+ fn register_builtin_macro ( & mut self , name : Symbol , ext : SyntaxExtensionKind ) {
181+ if self . builtin_macros . insert ( name, BuiltinMacroState :: NotYetSeen ( ext) ) . is_some ( ) {
181182 self . session
182- . span_err ( ident. span , & format ! ( "built-in macro `{}` was already defined" , ident) ) ;
183+ . diagnostic ( )
184+ . bug ( & format ! ( "built-in macro `{}` was already registered" , name) ) ;
183185 }
184186 }
185187
@@ -1096,7 +1098,7 @@ impl<'a> Resolver<'a> {
10961098 // while still taking everything else from the source code.
10971099 // If we already loaded this builtin macro, give a better error message than 'no such builtin macro'.
10981100 match mem:: replace ( builtin_macro, BuiltinMacroState :: AlreadySeen ( item. span ) ) {
1099- BuiltinMacroState :: NotYetSeen ( ext) => result. kind = ext. kind ,
1101+ BuiltinMacroState :: NotYetSeen ( ext) => result. kind = ext,
11001102 BuiltinMacroState :: AlreadySeen ( span) => {
11011103 struct_span_err ! (
11021104 self . session,
0 commit comments