@@ -660,10 +660,13 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
660
660
binding. map ( |binding| ( binding, Flags :: MODULE , Flags :: empty ( ) ) )
661
661
}
662
662
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
+ }
666
668
}
669
+ result
667
670
}
668
671
WhereToResolve :: BuiltinMacros => {
669
672
match self . builtin_macros . get ( & ident. name ) . cloned ( ) {
@@ -682,7 +685,8 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
682
685
}
683
686
}
684
687
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 ( )
686
690
. any ( |( name, _) | ident. name == & * * name) {
687
691
let binding = ( Def :: NonMacroAttr ( NonMacroAttrKind :: LegacyPluginHelper ) ,
688
692
ty:: Visibility :: Public , ident. span , Mark :: root ( ) )
0 commit comments