@@ -22,7 +22,7 @@ use rustc::{ty, lint};
2222use syntax:: ast:: { self , Name , Ident } ;
2323use syntax:: attr;
2424use syntax:: errors:: DiagnosticBuilder ;
25- use syntax:: ext:: base:: { self , Determinacy , MultiModifier , MultiDecorator } ;
25+ use syntax:: ext:: base:: { self , Determinacy } ;
2626use syntax:: ext:: base:: { MacroKind , SyntaxExtension , Resolver as SyntaxResolver } ;
2727use syntax:: ext:: expand:: { AstFragment , Invocation , InvocationKind , TogetherWith } ;
2828use syntax:: ext:: hygiene:: { self , Mark } ;
@@ -245,22 +245,10 @@ impl<'a, 'crateloader: 'a> base::Resolver for Resolver<'a, 'crateloader> {
245245 // Resolves attribute and derive legacy macros from `#![plugin(..)]`.
246246 fn find_legacy_attr_invoc ( & mut self , attrs : & mut Vec < ast:: Attribute > , allow_derive : bool )
247247 -> Option < ast:: Attribute > {
248- for i in 0 ..attrs. len ( ) {
249- let name = attrs[ i] . name ( ) ;
250-
251- match self . builtin_macros . get ( & name) . cloned ( ) {
252- Some ( binding) => match * binding. get_macro ( self ) {
253- MultiModifier ( ..) | MultiDecorator ( ..) | SyntaxExtension :: AttrProcMacro ( ..) => {
254- return Some ( attrs. remove ( i) )
255- }
256- _ => { }
257- } ,
258- None => { }
259- }
248+ if !allow_derive {
249+ return None ;
260250 }
261251
262- if !allow_derive { return None }
263-
264252 // Check for legacy derives
265253 for i in 0 ..attrs. len ( ) {
266254 let name = attrs[ i] . name ( ) ;
0 commit comments