@@ -4,7 +4,7 @@ use crate::attr::{self, HasAttrs};
44use crate :: source_map:: { dummy_spanned, respan} ;
55use crate :: config:: StripUnconfigured ;
66use crate :: ext:: base:: * ;
7- use crate :: ext:: proc_macro:: { add_derived_markers , collect_derives} ;
7+ use crate :: ext:: proc_macro:: collect_derives;
88use crate :: ext:: hygiene:: { ExpnId , SyntaxContext , ExpnInfo , ExpnKind } ;
99use crate :: ext:: placeholders:: { placeholder, PlaceholderExpander } ;
1010use crate :: feature_gate:: { self , Features , GateIssue , is_builtin_attr, emit_feature_err} ;
@@ -209,7 +209,6 @@ pub enum InvocationKind {
209209 Derive {
210210 path : Path ,
211211 item : Annotatable ,
212- item_with_markers : Annotatable ,
213212 } ,
214213 /// "Invocation" that contains all derives from an item,
215214 /// broken into multiple `Derive` invocations when expanded.
@@ -360,8 +359,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
360359
361360 let mut item = self . fully_configure ( item) ;
362361 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) ;
365362 let derives = derives. entry ( invoc. expansion_data . id ) . or_default ( ) ;
366363
367364 derives. reserve ( traits. len ( ) ) ;
@@ -370,11 +367,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
370367 let expn_id = ExpnId :: fresh ( self . cx . current_expansion . id , None ) ;
371368 derives. push ( expn_id) ;
372369 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 ( ) } ,
378371 fragment_kind : invoc. fragment_kind ,
379372 expansion_data : ExpansionData {
380373 id : expn_id,
@@ -383,7 +376,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
383376 } ) ;
384377 }
385378 let fragment = invoc. fragment_kind
386- . expect_from_annotatables ( :: std:: iter:: once ( item_with_markers ) ) ;
379+ . expect_from_annotatables ( :: std:: iter:: once ( item ) ) ;
387380 self . collect_invocations ( fragment, derives)
388381 } else {
389382 unreachable ! ( )
@@ -569,13 +562,9 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
569562 }
570563 _ => unreachable ! ( )
571564 }
572- InvocationKind :: Derive { path, item, item_with_markers } => match ext {
565+ InvocationKind :: Derive { path, item } => match ext {
573566 SyntaxExtensionKind :: Derive ( expander) |
574567 SyntaxExtensionKind :: LegacyDerive ( expander) => {
575- let ( path, item) = match ext {
576- SyntaxExtensionKind :: LegacyDerive ( ..) => ( path, item_with_markers) ,
577- _ => ( path, item) ,
578- } ;
579568 if !item. derive_allowed ( ) {
580569 return fragment_kind. dummy ( span) ;
581570 }
0 commit comments