@@ -135,7 +135,7 @@ pub enum MacroCallKind {
135135 Attr {
136136 ast_id : AstId < ast:: Item > ,
137137 attr_name : Box < str > ,
138- attr_args : ( tt:: Subtree , mbe:: TokenMap ) ,
138+ attr_args : Arc < ( tt:: Subtree , mbe:: TokenMap ) > ,
139139 /// Syntactical index of the invoking `#[attribute]`.
140140 ///
141141 /// Outer attributes are counted first, then inner attributes. This does not support
@@ -472,7 +472,7 @@ impl ExpansionInfo {
472472
473473 let token_range = token. value . text_range ( ) ;
474474 match & loc. kind {
475- MacroCallKind :: Attr { attr_args : ( _ , map ) , invoc_attr_index, .. } => {
475+ MacroCallKind :: Attr { attr_args, invoc_attr_index, .. } => {
476476 let attr = item
477477 . doc_comments_and_attrs ( )
478478 . nth ( * invoc_attr_index as usize )
@@ -486,8 +486,9 @@ impl ExpansionInfo {
486486 let relative_range =
487487 token. value . text_range ( ) . checked_sub ( attr_input_start) ?;
488488 // shift by the item's tree's max id
489- let token_id =
490- self . macro_arg_shift . shift ( map. token_by_range ( relative_range) ?) ;
489+ let token_id = self
490+ . macro_arg_shift
491+ . shift ( attr_args. 1 . token_by_range ( relative_range) ?) ;
491492 Some ( token_id)
492493 }
493494 _ => None ,
@@ -535,13 +536,13 @@ impl ExpansionInfo {
535536
536537 // Attributes are a bit special for us, they have two inputs, the input tokentree and the annotated item.
537538 let ( token_map, tt) = match & loc. kind {
538- MacroCallKind :: Attr { attr_args : ( _ , arg_token_map ) , .. } => {
539+ MacroCallKind :: Attr { attr_args, .. } => {
539540 // try unshifting the the token id, if unshifting fails, the token resides in the non-item attribute input
540541 // note that the `TokenExpander::map_id_up` earlier only unshifts for declarative macros, so we don't double unshift with this
541542 match self . macro_arg_shift . unshift ( token_id) {
542543 Some ( unshifted) => {
543544 token_id = unshifted;
544- ( arg_token_map , self . attr_input_or_mac_def . clone ( ) ?. syntax ( ) . cloned ( ) )
545+ ( & attr_args . 1 , self . attr_input_or_mac_def . clone ( ) ?. syntax ( ) . cloned ( ) )
545546 }
546547 None => ( & self . macro_arg . 1 , self . arg . clone ( ) ) ,
547548 }
0 commit comments