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