@@ -15,7 +15,7 @@ use rustc_attr::StabilityLevel;
15
15
use rustc_data_structures:: intern:: Interned ;
16
16
use rustc_data_structures:: sync:: Lrc ;
17
17
use rustc_errors:: { Applicability , StashKey } ;
18
- use rustc_expand:: base:: { Annotatable , DeriveResolutions , Indeterminate , ResolverExpand } ;
18
+ use rustc_expand:: base:: { Annotatable , DeriveResolution , Indeterminate , ResolverExpand } ;
19
19
use rustc_expand:: base:: { SyntaxExtension , SyntaxExtensionKind } ;
20
20
use rustc_expand:: compile_declarative_macro;
21
21
use rustc_expand:: expand:: { AstFragment , Invocation , InvocationKind , SupportsMacroExpansion } ;
@@ -344,7 +344,7 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
344
344
& mut self ,
345
345
expn_id : LocalExpnId ,
346
346
force : bool ,
347
- derive_paths : & dyn Fn ( ) -> DeriveResolutions ,
347
+ derive_paths : & dyn Fn ( ) -> Vec < DeriveResolution > ,
348
348
) -> Result < ( ) , Indeterminate > {
349
349
// Block expansion of the container until we resolve all derives in it.
350
350
// This is required for two reasons:
@@ -360,19 +360,19 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
360
360
has_derive_copy : false ,
361
361
} ) ;
362
362
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 (
366
366
match self . resolve_macro_path (
367
- path,
367
+ & resolution . path ,
368
368
Some ( MacroKind :: Derive ) ,
369
369
& parent_scope,
370
370
true ,
371
371
force,
372
372
) {
373
373
Ok ( ( Some ( ext) , _) ) => {
374
374
if !ext. helper_attrs . is_empty ( ) {
375
- let last_seg = path. segments . last ( ) . unwrap ( ) ;
375
+ let last_seg = resolution . path . segments . last ( ) . unwrap ( ) ;
376
376
let span = last_seg. ident . span . normalize_to_macros_2_0 ( ) ;
377
377
entry. helper_attrs . extend (
378
378
ext. helper_attrs
@@ -416,7 +416,7 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
416
416
Ok ( ( ) )
417
417
}
418
418
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 > > {
420
420
self . derive_data . remove ( & expn_id) . map ( |data| data. resolutions )
421
421
}
422
422
0 commit comments