@@ -4,7 +4,7 @@ use crate::attr::{self, HasAttrs};
4
4
use crate :: source_map:: { dummy_spanned, respan} ;
5
5
use crate :: config:: StripUnconfigured ;
6
6
use crate :: ext:: base:: * ;
7
- use crate :: ext:: proc_macro:: { add_derived_markers , collect_derives} ;
7
+ use crate :: ext:: proc_macro:: collect_derives;
8
8
use crate :: ext:: hygiene:: { ExpnId , SyntaxContext , ExpnInfo , ExpnKind } ;
9
9
use crate :: ext:: placeholders:: { placeholder, PlaceholderExpander } ;
10
10
use crate :: feature_gate:: { self , Features , GateIssue , is_builtin_attr, emit_feature_err} ;
@@ -209,7 +209,6 @@ pub enum InvocationKind {
209
209
Derive {
210
210
path : Path ,
211
211
item : Annotatable ,
212
- item_with_markers : Annotatable ,
213
212
} ,
214
213
/// "Invocation" that contains all derives from an item,
215
214
/// broken into multiple `Derive` invocations when expanded.
@@ -360,8 +359,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
360
359
361
360
let mut item = self . fully_configure ( item) ;
362
361
item. visit_attrs ( |attrs| attrs. retain ( |a| a. path != sym:: derive) ) ;
363
- let mut item_with_markers = item. clone ( ) ;
364
- add_derived_markers ( & mut self . cx , item. span ( ) , & traits, & mut item_with_markers) ;
365
362
let derives = derives. entry ( invoc. expansion_data . id ) . or_default ( ) ;
366
363
367
364
derives. reserve ( traits. len ( ) ) ;
@@ -370,11 +367,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
370
367
let expn_id = ExpnId :: fresh ( self . cx . current_expansion . id , None ) ;
371
368
derives. push ( expn_id) ;
372
369
invocations. push ( Invocation {
373
- kind : InvocationKind :: Derive {
374
- path,
375
- item : item. clone ( ) ,
376
- item_with_markers : item_with_markers. clone ( ) ,
377
- } ,
370
+ kind : InvocationKind :: Derive { path, item : item. clone ( ) } ,
378
371
fragment_kind : invoc. fragment_kind ,
379
372
expansion_data : ExpansionData {
380
373
id : expn_id,
@@ -383,7 +376,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
383
376
} ) ;
384
377
}
385
378
let fragment = invoc. fragment_kind
386
- . expect_from_annotatables ( :: std:: iter:: once ( item_with_markers ) ) ;
379
+ . expect_from_annotatables ( :: std:: iter:: once ( item ) ) ;
387
380
self . collect_invocations ( fragment, derives)
388
381
} else {
389
382
unreachable ! ( )
@@ -569,13 +562,9 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
569
562
}
570
563
_ => unreachable ! ( )
571
564
}
572
- InvocationKind :: Derive { path, item, item_with_markers } => match ext {
565
+ InvocationKind :: Derive { path, item } => match ext {
573
566
SyntaxExtensionKind :: Derive ( expander) |
574
567
SyntaxExtensionKind :: LegacyDerive ( expander) => {
575
- let ( path, item) = match ext {
576
- SyntaxExtensionKind :: LegacyDerive ( ..) => ( path, item_with_markers) ,
577
- _ => ( path, item) ,
578
- } ;
579
568
if !item. derive_allowed ( ) {
580
569
return fragment_kind. dummy ( span) ;
581
570
}
0 commit comments