@@ -107,7 +107,7 @@ pub fn is_known(attr: &Attribute) -> bool {
107107
108108impl NestedMetaItem {
109109 /// Returns the MetaItem if self is a NestedMetaItemKind::MetaItem.
110- pub fn meta_item ( & self ) -> Option < & P < MetaItem > > {
110+ pub fn meta_item ( & self ) -> Option < & MetaItem > {
111111 match self . node {
112112 NestedMetaItemKind :: MetaItem ( ref item) => Some ( & item) ,
113113 _ => None
@@ -145,7 +145,7 @@ impl NestedMetaItem {
145145 }
146146
147147 /// Returns a MetaItem if self is a MetaItem with Kind Word.
148- pub fn word ( & self ) -> Option < & P < MetaItem > > {
148+ pub fn word ( & self ) -> Option < & MetaItem > {
149149 self . meta_item ( ) . and_then ( |meta_item| if meta_item. is_word ( ) {
150150 Some ( meta_item)
151151 } else {
@@ -294,37 +294,37 @@ impl Attribute {
294294
295295/* Constructors */
296296
297- pub fn mk_name_value_item_str ( name : Name , value : InternedString ) -> P < MetaItem > {
297+ pub fn mk_name_value_item_str ( name : Name , value : InternedString ) -> MetaItem {
298298 let value_lit = dummy_spanned ( ast:: LitKind :: Str ( value, ast:: StrStyle :: Cooked ) ) ;
299299 mk_spanned_name_value_item ( DUMMY_SP , name, value_lit)
300300}
301301
302- pub fn mk_name_value_item ( name : Name , value : ast:: Lit ) -> P < MetaItem > {
302+ pub fn mk_name_value_item ( name : Name , value : ast:: Lit ) -> MetaItem {
303303 mk_spanned_name_value_item ( DUMMY_SP , name, value)
304304}
305305
306- pub fn mk_list_item ( name : Name , items : Vec < NestedMetaItem > ) -> P < MetaItem > {
306+ pub fn mk_list_item ( name : Name , items : Vec < NestedMetaItem > ) -> MetaItem {
307307 mk_spanned_list_item ( DUMMY_SP , name, items)
308308}
309309
310310pub fn mk_list_word_item ( name : Name ) -> ast:: NestedMetaItem {
311311 dummy_spanned ( NestedMetaItemKind :: MetaItem ( mk_spanned_word_item ( DUMMY_SP , name) ) )
312312}
313313
314- pub fn mk_word_item ( name : Name ) -> P < MetaItem > {
314+ pub fn mk_word_item ( name : Name ) -> MetaItem {
315315 mk_spanned_word_item ( DUMMY_SP , name)
316316}
317317
318- pub fn mk_spanned_name_value_item ( sp : Span , name : Name , value : ast:: Lit ) -> P < MetaItem > {
319- P ( MetaItem { span : sp, name : name, node : MetaItemKind :: NameValue ( value) } )
318+ pub fn mk_spanned_name_value_item ( sp : Span , name : Name , value : ast:: Lit ) -> MetaItem {
319+ MetaItem { span : sp, name : name, node : MetaItemKind :: NameValue ( value) }
320320}
321321
322- pub fn mk_spanned_list_item ( sp : Span , name : Name , items : Vec < NestedMetaItem > ) -> P < MetaItem > {
323- P ( MetaItem { span : sp, name : name, node : MetaItemKind :: List ( items) } )
322+ pub fn mk_spanned_list_item ( sp : Span , name : Name , items : Vec < NestedMetaItem > ) -> MetaItem {
323+ MetaItem { span : sp, name : name, node : MetaItemKind :: List ( items) }
324324}
325325
326- pub fn mk_spanned_word_item ( sp : Span , name : Name ) -> P < MetaItem > {
327- P ( MetaItem { span : sp, name : name, node : MetaItemKind :: Word } )
326+ pub fn mk_spanned_word_item ( sp : Span , name : Name ) -> MetaItem {
327+ MetaItem { span : sp, name : name, node : MetaItemKind :: Word }
328328}
329329
330330
@@ -341,12 +341,12 @@ pub fn mk_attr_id() -> AttrId {
341341}
342342
343343/// Returns an inner attribute with the given value.
344- pub fn mk_attr_inner ( id : AttrId , item : P < MetaItem > ) -> Attribute {
344+ pub fn mk_attr_inner ( id : AttrId , item : MetaItem ) -> Attribute {
345345 mk_spanned_attr_inner ( DUMMY_SP , id, item)
346346}
347347
348348/// Returns an innter attribute with the given value and span.
349- pub fn mk_spanned_attr_inner ( sp : Span , id : AttrId , item : P < MetaItem > ) -> Attribute {
349+ pub fn mk_spanned_attr_inner ( sp : Span , id : AttrId , item : MetaItem ) -> Attribute {
350350 Attribute {
351351 id : id,
352352 style : ast:: AttrStyle :: Inner ,
@@ -358,12 +358,12 @@ pub fn mk_spanned_attr_inner(sp: Span, id: AttrId, item: P<MetaItem>) -> Attribu
358358
359359
360360/// Returns an outer attribute with the given value.
361- pub fn mk_attr_outer ( id : AttrId , item : P < MetaItem > ) -> Attribute {
361+ pub fn mk_attr_outer ( id : AttrId , item : MetaItem ) -> Attribute {
362362 mk_spanned_attr_outer ( DUMMY_SP , id, item)
363363}
364364
365365/// Returns an outer attribute with the given value and span.
366- pub fn mk_spanned_attr_outer ( sp : Span , id : AttrId , item : P < MetaItem > ) -> Attribute {
366+ pub fn mk_spanned_attr_outer ( sp : Span , id : AttrId , item : MetaItem ) -> Attribute {
367367 Attribute {
368368 id : id,
369369 style : ast:: AttrStyle :: Outer ,
@@ -373,7 +373,7 @@ pub fn mk_spanned_attr_outer(sp: Span, id: AttrId, item: P<MetaItem>) -> Attribu
373373 }
374374}
375375
376- pub fn mk_doc_attr_outer ( id : AttrId , item : P < MetaItem > , is_sugared_doc : bool ) -> Attribute {
376+ pub fn mk_doc_attr_outer ( id : AttrId , item : MetaItem , is_sugared_doc : bool ) -> Attribute {
377377 Attribute {
378378 id : id,
379379 style : ast:: AttrStyle :: Outer ,
@@ -390,11 +390,11 @@ pub fn mk_sugared_doc_attr(id: AttrId, text: InternedString, lo: BytePos, hi: By
390390 Attribute {
391391 id : id,
392392 style : style,
393- value : P ( MetaItem {
393+ value : MetaItem {
394394 span : mk_sp ( lo, hi) ,
395395 name : token:: intern ( "doc" ) ,
396396 node : MetaItemKind :: NameValue ( lit) ,
397- } ) ,
397+ } ,
398398 is_sugared_doc : true ,
399399 span : mk_sp ( lo, hi) ,
400400 }
@@ -423,8 +423,7 @@ pub fn first_attr_value_str_by_name(attrs: &[Attribute], name: &str)
423423 . and_then ( |at| at. value_str ( ) )
424424}
425425
426- pub fn last_meta_item_value_str_by_name ( items : & [ P < MetaItem > ] , name : & str )
427- -> Option < InternedString > {
426+ pub fn last_meta_item_value_str_by_name ( items : & [ MetaItem ] , name : & str ) -> Option < InternedString > {
428427 items. iter ( )
429428 . rev ( )
430429 . find ( |mi| mi. check_name ( name) )
@@ -859,7 +858,7 @@ pub fn find_deprecation(diagnostic: &Handler, attrs: &[Attribute],
859858 find_deprecation_generic ( diagnostic, attrs. iter ( ) , item_sp)
860859}
861860
862- pub fn require_unique_names ( diagnostic : & Handler , metas : & [ P < MetaItem > ] ) {
861+ pub fn require_unique_names ( diagnostic : & Handler , metas : & [ MetaItem ] ) {
863862 let mut set = HashSet :: new ( ) ;
864863 for meta in metas {
865864 let name = meta. name ( ) ;
0 commit comments