@@ -228,10 +228,6 @@ pub enum MacroCallKind {
228228 /// We will resolve the same token tree for all derive macros in the same derive attribute.
229229 derive_macro_id : MacroCallId ,
230230 } ,
231- DeriveAttr {
232- ast_id : AstId < ast:: Adt > ,
233- invoc_attr_index : AttrId ,
234- } ,
235231 Attr {
236232 ast_id : AstId < ast:: Item > ,
237233 // FIXME: This shouldn't be here, we can derive this from `invoc_attr_index`
@@ -519,8 +515,7 @@ impl MacroCallLoc {
519515 MacroCallKind :: FnLike { ast_id, .. } => {
520516 ast_id. with_value ( ast_id. to_node ( db) . syntax ( ) . clone ( ) )
521517 }
522- MacroCallKind :: Derive { ast_id, derive_attr_index, .. }
523- | MacroCallKind :: DeriveAttr { ast_id, invoc_attr_index : derive_attr_index } => {
518+ MacroCallKind :: Derive { ast_id, derive_attr_index, .. } => {
524519 // FIXME: handle `cfg_attr`
525520 ast_id. with_value ( ast_id. to_node ( db) ) . map ( |it| {
526521 collect_attrs ( & it)
@@ -554,7 +549,7 @@ impl MacroCallLoc {
554549 fn expand_to ( & self ) -> ExpandTo {
555550 match self . kind {
556551 MacroCallKind :: FnLike { expand_to, .. } => expand_to,
557- MacroCallKind :: Derive { .. } | MacroCallKind :: DeriveAttr { .. } => ExpandTo :: Items ,
552+ MacroCallKind :: Derive { .. } => ExpandTo :: Items ,
558553 MacroCallKind :: Attr { .. } if self . def . is_attribute_derive ( ) => ExpandTo :: Items ,
559554 MacroCallKind :: Attr { .. } => {
560555 // FIXME(stmt_expr_attributes)
@@ -588,7 +583,6 @@ impl MacroCallKind {
588583 MacroCallKind :: FnLike { .. } => "macro call" ,
589584 MacroCallKind :: Derive { .. } => "derive macro" ,
590585 MacroCallKind :: Attr { .. } => "attribute macro" ,
591- MacroCallKind :: DeriveAttr { .. } => "derive attribute" ,
592586 }
593587 }
594588
@@ -597,16 +591,14 @@ impl MacroCallKind {
597591 match * self {
598592 MacroCallKind :: FnLike { ast_id : InFile { file_id, .. } , .. }
599593 | MacroCallKind :: Derive { ast_id : InFile { file_id, .. } , .. }
600- | MacroCallKind :: DeriveAttr { ast_id : InFile { file_id, .. } , .. }
601594 | MacroCallKind :: Attr { ast_id : InFile { file_id, .. } , .. } => file_id,
602595 }
603596 }
604597
605598 pub fn erased_ast_id ( & self ) -> ErasedFileAstId {
606599 match * self {
607600 MacroCallKind :: FnLike { ast_id : InFile { value, .. } , .. } => value. erase ( ) ,
608- MacroCallKind :: Derive { ast_id : InFile { value, .. } , .. }
609- | MacroCallKind :: DeriveAttr { ast_id : InFile { value, .. } , .. } => value. erase ( ) ,
601+ MacroCallKind :: Derive { ast_id : InFile { value, .. } , .. } => value. erase ( ) ,
610602 MacroCallKind :: Attr { ast_id : InFile { value, .. } , .. } => value. erase ( ) ,
611603 }
612604 }
@@ -627,9 +619,7 @@ impl MacroCallKind {
627619
628620 let range = match kind {
629621 MacroCallKind :: FnLike { ast_id, .. } => ast_id. to_ptr ( db) . text_range ( ) ,
630- MacroCallKind :: Derive { ast_id, .. } | MacroCallKind :: DeriveAttr { ast_id, .. } => {
631- ast_id. to_ptr ( db) . text_range ( )
632- }
622+ MacroCallKind :: Derive { ast_id, .. } => ast_id. to_ptr ( db) . text_range ( ) ,
633623 MacroCallKind :: Attr { ast_id, .. } => ast_id. to_ptr ( db) . text_range ( ) ,
634624 } ;
635625
@@ -675,15 +665,6 @@ impl MacroCallKind {
675665 . syntax ( )
676666 . text_range ( )
677667 }
678- MacroCallKind :: DeriveAttr { ast_id, invoc_attr_index } => {
679- collect_attrs ( & ast_id. to_node ( db) )
680- . nth ( invoc_attr_index. ast_index ( ) )
681- . expect ( "missing attribute" )
682- . 1
683- . expect_left ( "attribute macro is a doc comment?" )
684- . syntax ( )
685- . text_range ( )
686- }
687668 } ;
688669
689670 FileRange { range, file_id }
@@ -694,7 +675,7 @@ impl MacroCallKind {
694675 MacroCallKind :: FnLike { ast_id, .. } => {
695676 ast_id. to_in_file_node ( db) . map ( |it| Some ( it. token_tree ( ) ?. syntax ( ) . clone ( ) ) )
696677 }
697- MacroCallKind :: Derive { ast_id, .. } | MacroCallKind :: DeriveAttr { ast_id , .. } => {
678+ MacroCallKind :: Derive { ast_id, .. } => {
698679 ast_id. to_in_file_node ( db) . syntax ( ) . cloned ( ) . map ( Some )
699680 }
700681 MacroCallKind :: Attr { ast_id, .. } => {
0 commit comments