@@ -876,11 +876,15 @@ pub trait AttributeExt: Debug {
876876 /// a doc comment) will return `false`.
877877 fn is_doc_comment ( & self ) -> Option < Span > ;
878878
879+ /// Returns true if the attribute's first *and only* path segment is equal to the passed-in
880+ /// symbol.
879881 #[ inline]
880882 fn has_name ( & self , name : Symbol ) -> bool {
881883 self . name ( ) . map ( |x| x == name) . unwrap_or ( false )
882884 }
883885
886+ /// Returns true if the attribute's first *and only* path segment is any of the passed-in
887+ /// symbols.
884888 #[ inline]
885889 fn has_any_name ( & self , names : & [ Symbol ] ) -> bool {
886890 names. iter ( ) . any ( |& name| self . has_name ( name) )
@@ -889,6 +893,7 @@ pub trait AttributeExt: Debug {
889893 /// get the span of the entire attribute
890894 fn span ( & self ) -> Span ;
891895
896+ /// Returns whether the attribute is a path, without any arguments.
892897 fn is_word ( & self ) -> bool ;
893898
894899 fn path ( & self ) -> SmallVec < [ Symbol ; 1 ] > {
@@ -911,11 +916,14 @@ pub trait AttributeExt: Debug {
911916 /// * `#[deprecated(note = "note", ...)]` returns `Some("note")`.
912917 fn deprecation_note ( & self ) -> Option < Ident > ;
913918
919+ /// Returns whether this attribute is any of the proc macro attributes.
920+ /// i.e. `proc_macro`, `proc_macro_attribute` or `proc_macro_derive`.
914921 fn is_proc_macro_attr ( & self ) -> bool {
915922 [ sym:: proc_macro, sym:: proc_macro_attribute, sym:: proc_macro_derive]
916923 . iter ( )
917924 . any ( |kind| self . has_name ( * kind) )
918925 }
926+ /// Returns true if this attribute is `#[automatically_deived]`.
919927 fn is_automatically_derived_attr ( & self ) -> bool ;
920928
921929 /// Returns the documentation and its kind if this is a doc comment or a sugared doc comment.
0 commit comments