@@ -81,19 +81,15 @@ crate struct ExternalCrate {
8181/// directly to the AST's concept of an item; it's a strict superset.
8282#[ derive( Clone ) ]
8383crate struct Item {
84- /// The [`Span`] of this item in the source code.
8584 crate span : Span ,
8685 /// The name of this item.
8786 /// Optional because not every item has a name, e.g. impls.
8887 crate name : Option < Symbol > ,
89- /// Attributes on this item, e.g. `#[derive(...)]` or `#[inline]`.
9088 crate attrs : Box < Attributes > ,
91- /// The visibility of this item (private, `pub`, `pub(crate)`, etc.).
9289 crate visibility : Visibility ,
9390 /// Information about this item that is specific to what kind of item it is.
9491 /// E.g., struct vs enum vs function.
9592 crate kind : Box < ItemKind > ,
96- /// The [`DefId`] of this item.
9793 crate def_id : DefId ,
9894}
9995
@@ -565,6 +561,8 @@ impl<'a> FromIterator<&'a DocFragment> for String {
565561 }
566562}
567563
564+ /// The attributes on an [`Item`], including attributes like `#[derive(...)]` and `#[inline]`,
565+ /// as well as doc comments.
568566#[ derive( Clone , Debug , Default ) ]
569567crate struct Attributes {
570568 crate doc_strings : Vec < DocFragment > ,
@@ -1804,8 +1802,11 @@ impl From<hir::PrimTy> for PrimitiveType {
18041802
18051803#[ derive( Copy , Clone , Debug ) ]
18061804crate enum Visibility {
1805+ /// `pub`
18071806 Public ,
1807+ /// visibility inherited from parent (e.g. for enum variant fields)
18081808 Inherited ,
1809+ /// `pub(crate)`, `pub(super)`, or `pub(in path::to::somewhere)`
18091810 Restricted ( DefId ) ,
18101811}
18111812
@@ -1854,7 +1855,8 @@ crate enum Variant {
18541855 Struct ( VariantStruct ) ,
18551856}
18561857
1857- /// Small wrapper around `rustc_span::Span` that adds helper methods and enforces calling `source_callsite`.
1858+ /// Small wrapper around [`rustc_span::Span]` that adds helper methods
1859+ /// and enforces calling [`rustc_span::Span::source_callsite()`].
18581860#[ derive( Clone , Debug ) ]
18591861crate struct Span ( rustc_span:: Span ) ;
18601862
0 commit comments