@@ -568,10 +568,9 @@ impl<'a> Resolver<'a> {
568568 struct Flags : u8 {
569569 const MACRO_RULES = 1 << 0 ;
570570 const MODULE = 1 << 1 ;
571- const DERIVE_HELPER_COMPAT = 1 << 2 ;
572- const MISC_SUGGEST_CRATE = 1 << 3 ;
573- const MISC_SUGGEST_SELF = 1 << 4 ;
574- const MISC_FROM_PRELUDE = 1 << 5 ;
571+ const MISC_SUGGEST_CRATE = 1 << 2 ;
572+ const MISC_SUGGEST_SELF = 1 << 3 ;
573+ const MISC_FROM_PRELUDE = 1 << 4 ;
575574 }
576575 }
577576
@@ -646,14 +645,11 @@ impl<'a> Resolver<'a> {
646645 ) {
647646 Ok ( ( Some ( ext) , _) ) => {
648647 if ext. helper_attrs . contains ( & ident. name ) {
649- let binding = (
650- Res :: NonMacroAttr ( NonMacroAttrKind :: DeriveHelper ) ,
651- ty:: Visibility :: Public ,
648+ result = ok (
649+ Res :: NonMacroAttr ( NonMacroAttrKind :: DeriveHelperCompat ) ,
652650 derive. span ,
653- ExpnId :: root ( ) ,
654- )
655- . to_name_binding ( this. arenas ) ;
656- result = Ok ( ( binding, Flags :: DERIVE_HELPER_COMPAT ) ) ;
651+ this. arenas ,
652+ ) ;
657653 break ;
658654 }
659655 }
@@ -799,17 +795,15 @@ impl<'a> Resolver<'a> {
799795 let ( res, innermost_res) = ( binding. res ( ) , innermost_binding. res ( ) ) ;
800796 if res != innermost_res {
801797 let builtin = Res :: NonMacroAttr ( NonMacroAttrKind :: Builtin ) ;
802- let is_derive_helper_compat = |res, flags : Flags | {
803- res == Res :: NonMacroAttr ( NonMacroAttrKind :: DeriveHelper )
804- && flags. contains ( Flags :: DERIVE_HELPER_COMPAT )
805- } ;
798+ let derive_helper_compat =
799+ Res :: NonMacroAttr ( NonMacroAttrKind :: DeriveHelperCompat ) ;
806800
807801 let ambiguity_error_kind = if is_import {
808802 Some ( AmbiguityKind :: Import )
809803 } else if innermost_res == builtin || res == builtin {
810804 Some ( AmbiguityKind :: BuiltinAttr )
811- } else if is_derive_helper_compat ( innermost_res, innermost_flags )
812- || is_derive_helper_compat ( res, flags )
805+ } else if innermost_res == derive_helper_compat
806+ || res == derive_helper_compat
813807 {
814808 Some ( AmbiguityKind :: DeriveHelper )
815809 } else if innermost_flags. contains ( Flags :: MACRO_RULES )
0 commit comments