@@ -9,7 +9,7 @@ pub use StabilityLevel::*;
9
9
pub use crate :: ast:: Attribute ;
10
10
11
11
use crate :: ast;
12
- use crate :: ast:: { AttrId , AttrStyle , Name , Ident , Path , PathSegment } ;
12
+ use crate :: ast:: { AttrItem , AttrId , AttrStyle , Name , Ident , Path , PathSegment } ;
13
13
use crate :: ast:: { MetaItem , MetaItemKind , NestedMetaItem } ;
14
14
use crate :: ast:: { Lit , LitKind , Expr , Item , Local , Stmt , StmtKind , GenericParam } ;
15
15
use crate :: mut_visit:: visit_clobber;
@@ -333,10 +333,9 @@ impl Attribute {
333
333
DUMMY_SP ,
334
334
) ;
335
335
f ( & Attribute {
336
+ item : AttrItem { path : meta. path , tokens : meta. kind . tokens ( meta. span ) } ,
336
337
id : self . id ,
337
338
style : self . style ,
338
- path : meta. path ,
339
- tokens : meta. kind . tokens ( meta. span ) ,
340
339
is_sugared_doc : true ,
341
340
span : self . span ,
342
341
} )
@@ -384,10 +383,9 @@ crate fn mk_attr_id() -> AttrId {
384
383
385
384
pub fn mk_attr ( style : AttrStyle , path : Path , tokens : TokenStream , span : Span ) -> Attribute {
386
385
Attribute {
386
+ item : AttrItem { path, tokens } ,
387
387
id : mk_attr_id ( ) ,
388
388
style,
389
- path,
390
- tokens,
391
389
is_sugared_doc : false ,
392
390
span,
393
391
}
@@ -408,10 +406,12 @@ pub fn mk_sugared_doc_attr(text: Symbol, span: Span) -> Attribute {
408
406
let lit_kind = LitKind :: Str ( text, ast:: StrStyle :: Cooked ) ;
409
407
let lit = Lit :: from_lit_kind ( lit_kind, span) ;
410
408
Attribute {
409
+ item : AttrItem {
410
+ path : Path :: from_ident ( Ident :: with_dummy_span ( sym:: doc) . with_span_pos ( span) ) ,
411
+ tokens : MetaItemKind :: NameValue ( lit) . tokens ( span) ,
412
+ } ,
411
413
id : mk_attr_id ( ) ,
412
414
style,
413
- path : Path :: from_ident ( Ident :: with_dummy_span ( sym:: doc) . with_span_pos ( span) ) ,
414
- tokens : MetaItemKind :: NameValue ( lit) . tokens ( span) ,
415
415
is_sugared_doc : true ,
416
416
span,
417
417
}
0 commit comments