@@ -22,7 +22,7 @@ use rustc::{ty, lint};
22
22
use syntax:: ast:: { self , Name , Ident } ;
23
23
use syntax:: attr;
24
24
use syntax:: errors:: DiagnosticBuilder ;
25
- use syntax:: ext:: base:: { self , Determinacy , MultiModifier , MultiDecorator } ;
25
+ use syntax:: ext:: base:: { self , Determinacy } ;
26
26
use syntax:: ext:: base:: { MacroKind , SyntaxExtension , Resolver as SyntaxResolver } ;
27
27
use syntax:: ext:: expand:: { AstFragment , Invocation , InvocationKind , TogetherWith } ;
28
28
use syntax:: ext:: hygiene:: { self , Mark } ;
@@ -245,22 +245,10 @@ impl<'a, 'crateloader: 'a> base::Resolver for Resolver<'a, 'crateloader> {
245
245
// Resolves attribute and derive legacy macros from `#![plugin(..)]`.
246
246
fn find_legacy_attr_invoc ( & mut self , attrs : & mut Vec < ast:: Attribute > , allow_derive : bool )
247
247
-> 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 ;
260
250
}
261
251
262
- if !allow_derive { return None }
263
-
264
252
// Check for legacy derives
265
253
for i in 0 ..attrs. len ( ) {
266
254
let name = attrs[ i] . name ( ) ;
0 commit comments