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