@@ -659,10 +659,13 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
659659 binding. map ( |binding| ( binding, Flags :: MODULE , Flags :: empty ( ) ) )
660660 }
661661 WhereToResolve :: MacroUsePrelude => {
662- match self . macro_use_prelude . get ( & ident. name ) . cloned ( ) {
663- Some ( binding) => Ok ( ( binding, Flags :: PRELUDE , Flags :: empty ( ) ) ) ,
664- None => Err ( Determinacy :: Determined ) ,
662+ let mut result = Err ( Determinacy :: Determined ) ;
663+ if use_prelude || self . session . rust_2015 ( ) {
664+ if let Some ( binding) = self . macro_use_prelude . get ( & ident. name ) . cloned ( ) {
665+ result = Ok ( ( binding, Flags :: PRELUDE , Flags :: empty ( ) ) ) ;
666+ }
665667 }
668+ result
666669 }
667670 WhereToResolve :: BuiltinMacros => {
668671 match self . builtin_macros . get ( & ident. name ) . cloned ( ) {
@@ -681,7 +684,8 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
681684 }
682685 }
683686 WhereToResolve :: LegacyPluginHelpers => {
684- if self . session . plugin_attributes . borrow ( ) . iter ( )
687+ if ( use_prelude || self . session . rust_2015 ( ) ) &&
688+ self . session . plugin_attributes . borrow ( ) . iter ( )
685689 . any ( |( name, _) | ident. name == & * * name) {
686690 let binding = ( Def :: NonMacroAttr ( NonMacroAttrKind :: LegacyPluginHelper ) ,
687691 ty:: Visibility :: Public , ident. span , Mark :: root ( ) )
0 commit comments