@@ -15,7 +15,7 @@ use rustc_attr::StabilityLevel;
1515use rustc_data_structures:: intern:: Interned ;
1616use rustc_data_structures:: sync:: Lrc ;
1717use rustc_errors:: { Applicability , StashKey } ;
18- use rustc_expand:: base:: { Annotatable , DeriveResolutions , Indeterminate , ResolverExpand } ;
18+ use rustc_expand:: base:: { Annotatable , DeriveResolution , Indeterminate , ResolverExpand } ;
1919use rustc_expand:: base:: { SyntaxExtension , SyntaxExtensionKind } ;
2020use rustc_expand:: compile_declarative_macro;
2121use rustc_expand:: expand:: { AstFragment , Invocation , InvocationKind , SupportsMacroExpansion } ;
@@ -344,7 +344,7 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
344344 & mut self ,
345345 expn_id : LocalExpnId ,
346346 force : bool ,
347- derive_paths : & dyn Fn ( ) -> DeriveResolutions ,
347+ derive_paths : & dyn Fn ( ) -> Vec < DeriveResolution > ,
348348 ) -> Result < ( ) , Indeterminate > {
349349 // Block expansion of the container until we resolve all derives in it.
350350 // This is required for two reasons:
@@ -360,19 +360,19 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
360360 has_derive_copy : false ,
361361 } ) ;
362362 let parent_scope = self . invocation_parent_scopes [ & expn_id] ;
363- for ( i, ( path , _ , opt_ext , _ ) ) in entry. resolutions . iter_mut ( ) . enumerate ( ) {
364- if opt_ext . is_none ( ) {
365- * opt_ext = Some (
363+ for ( i, resolution ) in entry. resolutions . iter_mut ( ) . enumerate ( ) {
364+ if resolution . exts . is_none ( ) {
365+ resolution . exts = Some (
366366 match self . resolve_macro_path (
367- path,
367+ & resolution . path ,
368368 Some ( MacroKind :: Derive ) ,
369369 & parent_scope,
370370 true ,
371371 force,
372372 ) {
373373 Ok ( ( Some ( ext) , _) ) => {
374374 if !ext. helper_attrs . is_empty ( ) {
375- let last_seg = path. segments . last ( ) . unwrap ( ) ;
375+ let last_seg = resolution . path . segments . last ( ) . unwrap ( ) ;
376376 let span = last_seg. ident . span . normalize_to_macros_2_0 ( ) ;
377377 entry. helper_attrs . extend (
378378 ext. helper_attrs
@@ -416,7 +416,7 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
416416 Ok ( ( ) )
417417 }
418418
419- fn take_derive_resolutions ( & mut self , expn_id : LocalExpnId ) -> Option < DeriveResolutions > {
419+ fn take_derive_resolutions ( & mut self , expn_id : LocalExpnId ) -> Option < Vec < DeriveResolution > > {
420420 self . derive_data . remove ( & expn_id) . map ( |data| data. resolutions )
421421 }
422422
0 commit comments