@@ -103,7 +103,7 @@ impl RawAttrs {
103
103
match attr {
104
104
Either :: Left ( attr) => Attr :: from_src ( attr, hygiene, index) ,
105
105
Either :: Right ( comment) => comment. doc_comment ( ) . map ( |doc| Attr {
106
- index,
106
+ id : index,
107
107
input : Some ( AttrInput :: Literal ( SmolStr :: new ( doc) ) ) ,
108
108
path : Interned :: new ( ModPath :: from ( hir_expand:: name!( doc) ) ) ,
109
109
} ) ,
@@ -164,7 +164,7 @@ impl RawAttrs {
164
164
let cfg = parts. next ( ) . unwrap ( ) ;
165
165
let cfg = Subtree { delimiter : subtree. delimiter , token_trees : cfg. to_vec ( ) } ;
166
166
let cfg = CfgExpr :: parse ( & cfg) ;
167
- let index = attr. index ;
167
+ let index = attr. id ;
168
168
let attrs = parts. filter ( |a| !a. is_empty ( ) ) . filter_map ( |attr| {
169
169
let tree = Subtree { delimiter : None , token_trees : attr. to_vec ( ) } ;
170
170
let attr = ast:: Attr :: parse ( & format ! ( "#[{}]" , tree) ) . ok ( ) ?;
@@ -471,7 +471,7 @@ impl AttrsWithOwner {
471
471
) -> Option < ( Documentation , DocsRangeMap ) > {
472
472
// FIXME: code duplication in `docs` above
473
473
let docs = self . by_key ( "doc" ) . attrs ( ) . flat_map ( |attr| match attr. input . as_ref ( ) ? {
474
- AttrInput :: Literal ( s) => Some ( ( s, attr. index ) ) ,
474
+ AttrInput :: Literal ( s) => Some ( ( s, attr. id ) ) ,
475
475
AttrInput :: TokenTree ( _) => None ,
476
476
} ) ;
477
477
let indent = docs
@@ -563,8 +563,8 @@ impl AttrSourceMap {
563
563
/// the attribute represented by `Attr`.
564
564
pub fn source_of ( & self , attr : & Attr ) -> InFile < & Either < ast:: Attr , ast:: Comment > > {
565
565
self . attrs
566
- . get ( attr. index . 0 as usize )
567
- . unwrap_or_else ( || panic ! ( "cannot find `Attr` at index {:?}" , attr. index ) )
566
+ . get ( attr. id . 0 as usize )
567
+ . unwrap_or_else ( || panic ! ( "cannot find `Attr` at index {:?}" , attr. id ) )
568
568
. as_ref ( )
569
569
}
570
570
}
@@ -609,7 +609,7 @@ impl DocsRangeMap {
609
609
610
610
#[ derive( Debug , Clone , PartialEq , Eq ) ]
611
611
pub struct Attr {
612
- pub ( crate ) index : AttrId ,
612
+ pub ( crate ) id : AttrId ,
613
613
pub ( crate ) path : Interned < ModPath > ,
614
614
pub ( crate ) input : Option < AttrInput > ,
615
615
}
@@ -623,7 +623,7 @@ pub enum AttrInput {
623
623
}
624
624
625
625
impl Attr {
626
- fn from_src ( ast : ast:: Attr , hygiene : & Hygiene , index : AttrId ) -> Option < Attr > {
626
+ fn from_src ( ast : ast:: Attr , hygiene : & Hygiene , id : AttrId ) -> Option < Attr > {
627
627
let path = Interned :: new ( ModPath :: from_src ( ast. path ( ) ?, hygiene) ?) ;
628
628
let input = if let Some ( ast:: Expr :: Literal ( lit) ) = ast. expr ( ) {
629
629
let value = match lit. kind ( ) {
@@ -636,7 +636,7 @@ impl Attr {
636
636
} else {
637
637
None
638
638
} ;
639
- Some ( Attr { index , path, input } )
639
+ Some ( Attr { id , path, input } )
640
640
}
641
641
642
642
/// Parses this attribute as a `#[derive]`, returns an iterator that yields all contained paths
0 commit comments