@@ -135,7 +135,7 @@ pub enum MacroCallKind {
135
135
Attr {
136
136
ast_id : AstId < ast:: Item > ,
137
137
attr_name : Box < str > ,
138
- attr_args : ( tt:: Subtree , mbe:: TokenMap ) ,
138
+ attr_args : Arc < ( tt:: Subtree , mbe:: TokenMap ) > ,
139
139
/// Syntactical index of the invoking `#[attribute]`.
140
140
///
141
141
/// Outer attributes are counted first, then inner attributes. This does not support
@@ -472,7 +472,7 @@ impl ExpansionInfo {
472
472
473
473
let token_range = token. value . text_range ( ) ;
474
474
match & loc. kind {
475
- MacroCallKind :: Attr { attr_args : ( _ , map ) , invoc_attr_index, .. } => {
475
+ MacroCallKind :: Attr { attr_args, invoc_attr_index, .. } => {
476
476
let attr = item
477
477
. doc_comments_and_attrs ( )
478
478
. nth ( * invoc_attr_index as usize )
@@ -486,8 +486,9 @@ impl ExpansionInfo {
486
486
let relative_range =
487
487
token. value . text_range ( ) . checked_sub ( attr_input_start) ?;
488
488
// 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) ?) ;
491
492
Some ( token_id)
492
493
}
493
494
_ => None ,
@@ -535,13 +536,13 @@ impl ExpansionInfo {
535
536
536
537
// Attributes are a bit special for us, they have two inputs, the input tokentree and the annotated item.
537
538
let ( token_map, tt) = match & loc. kind {
538
- MacroCallKind :: Attr { attr_args : ( _ , arg_token_map ) , .. } => {
539
+ MacroCallKind :: Attr { attr_args, .. } => {
539
540
// try unshifting the the token id, if unshifting fails, the token resides in the non-item attribute input
540
541
// note that the `TokenExpander::map_id_up` earlier only unshifts for declarative macros, so we don't double unshift with this
541
542
match self . macro_arg_shift . unshift ( token_id) {
542
543
Some ( unshifted) => {
543
544
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 ( ) )
545
546
}
546
547
None => ( & self . macro_arg . 1 , self . arg . clone ( ) ) ,
547
548
}
0 commit comments