@@ -9,7 +9,7 @@ pub use StabilityLevel::*;
99pub use crate :: ast:: Attribute ;
1010
1111use crate :: ast;
12- use crate :: ast:: { AttrId , AttrStyle , Name , Ident , Path , PathSegment } ;
12+ use crate :: ast:: { AttrItem , AttrId , AttrStyle , Name , Ident , Path , PathSegment } ;
1313use crate :: ast:: { MetaItem , MetaItemKind , NestedMetaItem } ;
1414use crate :: ast:: { Lit , LitKind , Expr , Item , Local , Stmt , StmtKind , GenericParam } ;
1515use crate :: mut_visit:: visit_clobber;
@@ -333,10 +333,9 @@ impl Attribute {
333333 DUMMY_SP ,
334334 ) ;
335335 f ( & Attribute {
336+ item : AttrItem { path : meta. path , tokens : meta. kind . tokens ( meta. span ) } ,
336337 id : self . id ,
337338 style : self . style ,
338- path : meta. path ,
339- tokens : meta. kind . tokens ( meta. span ) ,
340339 is_sugared_doc : true ,
341340 span : self . span ,
342341 } )
@@ -384,10 +383,9 @@ crate fn mk_attr_id() -> AttrId {
384383
385384pub fn mk_attr ( style : AttrStyle , path : Path , tokens : TokenStream , span : Span ) -> Attribute {
386385 Attribute {
386+ item : AttrItem { path, tokens } ,
387387 id : mk_attr_id ( ) ,
388388 style,
389- path,
390- tokens,
391389 is_sugared_doc : false ,
392390 span,
393391 }
@@ -408,10 +406,12 @@ pub fn mk_sugared_doc_attr(text: Symbol, span: Span) -> Attribute {
408406 let lit_kind = LitKind :: Str ( text, ast:: StrStyle :: Cooked ) ;
409407 let lit = Lit :: from_lit_kind ( lit_kind, span) ;
410408 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+ } ,
411413 id : mk_attr_id ( ) ,
412414 style,
413- path : Path :: from_ident ( Ident :: with_dummy_span ( sym:: doc) . with_span_pos ( span) ) ,
414- tokens : MetaItemKind :: NameValue ( lit) . tokens ( span) ,
415415 is_sugared_doc : true ,
416416 span,
417417 }
0 commit comments