Skip to content

Commit

Permalink
Fix doc links now that crate::* is no longer imported
Browse files Browse the repository at this point in the history
    warning: unresolved link to `parse::Parse`
       --> src/macros.rs:36:11
        |
    36  |           $(#[$attr])* $pub $struct $name $body
        |             ^^^^^^^^
        |
       ::: src/attr.rs:19:1
        |
    19  | / ast_struct! {
    20  | |     /// An attribute, like `#[repr(transparent)]`.
    21  | |     ///
    22  | |     /// <br>
    ...   |
    178 | |     }
    179 | | }
        | |_- in this macro invocation
        |
        = note: the link appears in this line:

                [`Parse`]: parse::Parse
                           ^^^^^^^^^^^^
        = note: no item named `parse` in scope
        = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
        = note: this warning originates in the macro `ast_struct` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: unresolved link to `parse::ParseBuffer::parse`
       --> src/macros.rs:36:11
        |
    36  |           $(#[$attr])* $pub $struct $name $body
        |             ^^^^^^^^
        |
       ::: src/attr.rs:19:1
        |
    19  | / ast_struct! {
    20  | |     /// An attribute, like `#[repr(transparent)]`.
    21  | |     ///
    22  | |     /// <br>
    ...   |
    178 | |     }
    179 | | }
        | |_- in this macro invocation
        |
        = note: the link appears in this line:

                [`ParseStream::parse`]: parse::ParseBuffer::parse
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
        = note: no item named `parse` in scope
        = note: this warning originates in the macro `ast_struct` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: unresolved link to `parse::ParseBuffer::call`
       --> src/macros.rs:36:11
        |
    36  |           $(#[$attr])* $pub $struct $name $body
        |             ^^^^^^^^
        |
       ::: src/attr.rs:19:1
        |
    19  | / ast_struct! {
    20  | |     /// An attribute, like `#[repr(transparent)]`.
    21  | |     ///
    22  | |     /// <br>
    ...   |
    178 | |     }
    179 | | }
        | |_- in this macro invocation
        |
        = note: the link appears in this line:

                [`ParseStream::call`]: parse::ParseBuffer::call
                                       ^^^^^^^^^^^^^^^^^^^^^^^^
        = note: no item named `parse` in scope
        = note: this warning originates in the macro `ast_struct` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: unresolved link to `Expr`
      --> src/macros.rs:49:11
       |
    49 |           $(#[$enum_attr])* $pub $enum $name $body
       |             ^^^^^^^^^^^^^
       |
      ::: src/derive.rs:21:1
       |
    21 | / ast_enum! {
    22 | |     /// The storage of a struct, enum or union data structure.
    23 | |     ///
    24 | |     /// # Syntax tree enum
    ...  |
    34 | |     }
    35 | | }
       | |_- in this macro invocation
       |
       = note: the link appears in this line:

               [syntax tree enum]: Expr#syntax-tree-enums
                                   ^^^^^^^^^^^^^^^^^^^^^^
       = note: no item named `Expr` in scope
       = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
       = note: this warning originates in the macro `ast_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: unresolved link to `parse_file`
      --> src/macros.rs:36:11
       |
    36 |           $(#[$attr])* $pub $struct $name $body
       |             ^^^^^^^^
       |
      ::: src/file.rs:4:1
       |
    4  | / ast_struct! {
    5  | |     /// A complete file of Rust source code.
    6  | |     ///
    7  | |     /// Typically `File` objects are created with [`parse_file`].
    ...  |
    86 | |     }
    87 | | }
       | |_- in this macro invocation
       |
       = note: the link appears in this line:

               Typically `File` objects are created with [`parse_file`].
                                                          ^^^^^^^^^^^^
       = note: no item named `parse_file` in scope
       = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
       = note: this warning originates in the macro `ast_struct` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: unresolved link to `Expr`
       --> src/macros.rs:61:11
        |
    61  |           $(#[$enum_attr])* $pub $enum $name $body
        |             ^^^^^^^^^^^^^
        |
       ::: src/pat.rs:15:1
        |
    15  | / ast_enum_of_structs! {
    16  | |     /// A pattern in a local binding, function signature, match expression, or
    17  | |     /// various other places.
    18  | |     ///
    ...   |
    101 | |     }
    102 | | }
        | |_- in this macro invocation
        |
        = note: the link appears in this line:

                [syntax tree enum]: Expr#syntax-tree-enums
                                    ^^^^^^^^^^^^^^^^^^^^^^
        = note: no item named `Expr` in scope
        = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
        = note: this warning originates in the macro `ast_enum_of_structs` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: unresolved link to `Expr`
      --> src/macros.rs:49:11
       |
    49 |           $(#[$enum_attr])* $pub $enum $name $body
       |             ^^^^^^^^^^^^^
       |
      ::: src/restriction.rs:4:1
       |
    4  | / ast_enum! {
    5  | |     /// The visibility level of an item: inherited or `pub` or
    6  | |     /// `pub(restricted)`.
    7  | |     ///
    ...  |
    24 | |     }
    25 | | }
       | |_- in this macro invocation
       |
       = note: the link appears in this line:

               [syntax tree enum]: Expr#syntax-tree-enums
                                   ^^^^^^^^^^^^^^^^^^^^^^
       = note: no item named `Expr` in scope
       = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
       = note: this warning originates in the macro `ast_enum` (in Nightly builds, run with -Z macro-backtrace for more info)
  • Loading branch information
dtolnay committed Feb 19, 2024
1 parent 713f932 commit 07a435d
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ ast_struct! {
/// [`Attribute::parse_outer`] or [`Attribute::parse_inner`] depending on
/// which you intend to parse.
///
/// [`Parse`]: parse::Parse
/// [`ParseStream::parse`]: parse::ParseBuffer::parse
/// [`ParseStream::call`]: parse::ParseBuffer::call
/// [`Parse`]: crate::parse::Parse
/// [`ParseStream::parse`]: crate::parse::ParseBuffer::parse
/// [`ParseStream::call`]: crate::parse::ParseBuffer::call
///
/// ```
/// use syn::{Attribute, Ident, Result, Token};
Expand Down Expand Up @@ -468,7 +468,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
pub enum Meta {
Path(Path),
Expand Down
2 changes: 1 addition & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
pub enum Fields {
/// Named fields of a struct or struct variant such as `Point { x: f64,
Expand Down
2 changes: 1 addition & 1 deletion src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ast_enum! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
pub enum Data {
Struct(DataStruct),
Expand Down
2 changes: 2 additions & 0 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ast_struct! {
///
/// Typically `File` objects are created with [`parse_file`].
///
/// [`parse_file`]: crate::parse_file
///
/// # Example
///
/// Parse a Rust source file into a `syn::File` and print out a debug
Expand Down
4 changes: 2 additions & 2 deletions src/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
pub enum GenericParam {
/// A lifetime parameter: `'a: 'b + 'c + 'd`.
Expand Down Expand Up @@ -499,7 +499,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
#[non_exhaustive]
pub enum WherePredicate {
Expand Down
10 changes: 5 additions & 5 deletions src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
#[non_exhaustive]
pub enum Item {
Expand Down Expand Up @@ -428,7 +428,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
pub enum UseTree {
/// A path prefix of imports in a `use` item: `std::...`.
Expand Down Expand Up @@ -500,7 +500,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
#[non_exhaustive]
pub enum ForeignItem {
Expand Down Expand Up @@ -595,7 +595,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
#[non_exhaustive]
pub enum TraitItem {
Expand Down Expand Up @@ -692,7 +692,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
#[non_exhaustive]
pub enum ImplItem {
Expand Down
2 changes: 1 addition & 1 deletion src/lit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: crate::Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[non_exhaustive]
pub enum Lit {
/// A UTF-8 string literal: `"foo"`.
Expand Down
2 changes: 1 addition & 1 deletion src/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
#[non_exhaustive]
pub enum Pat {
Expand Down
2 changes: 1 addition & 1 deletion src/restriction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ast_enum! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
pub enum Visibility {
/// A public visibility level: `pub`.
Expand Down
2 changes: 1 addition & 1 deletion src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ast_enum_of_structs! {
///
/// This type is a [syntax tree enum].
///
/// [syntax tree enum]: Expr#syntax-tree-enums
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
#[non_exhaustive]
pub enum Type {
Expand Down

0 comments on commit 07a435d

Please sign in to comment.