From 07a435df6739d47d54e933970eddfc6764bd519d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 19 Feb 2024 14:59:37 -0800 Subject: [PATCH] Fix doc links now that crate::* is no longer imported 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 | | ///
... | 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 | | ///
... | 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 | | ///
... | 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) --- src/attr.rs | 8 ++++---- src/data.rs | 2 +- src/derive.rs | 2 +- src/file.rs | 2 ++ src/generics.rs | 4 ++-- src/item.rs | 10 +++++----- src/lit.rs | 2 +- src/pat.rs | 2 +- src/restriction.rs | 2 +- src/ty.rs | 2 +- 10 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/attr.rs b/src/attr.rs index 5d85895288..589e4278eb 100644 --- a/src/attr.rs +++ b/src/attr.rs @@ -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}; @@ -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), diff --git a/src/data.rs b/src/data.rs index febf39acc2..9fb97e483b 100644 --- a/src/data.rs +++ b/src/data.rs @@ -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, diff --git a/src/derive.rs b/src/derive.rs index 277fef7939..dbb2cf6a8c 100644 --- a/src/derive.rs +++ b/src/derive.rs @@ -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), diff --git a/src/file.rs b/src/file.rs index f728ab9ce9..760e5a6225 100644 --- a/src/file.rs +++ b/src/file.rs @@ -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 diff --git a/src/generics.rs b/src/generics.rs index 0299d74a81..a3cd5e6298 100644 --- a/src/generics.rs +++ b/src/generics.rs @@ -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`. @@ -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 { diff --git a/src/item.rs b/src/item.rs index 22447bb318..95a143659d 100644 --- a/src/item.rs +++ b/src/item.rs @@ -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 { @@ -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::...`. @@ -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 { @@ -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 { @@ -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 { diff --git a/src/lit.rs b/src/lit.rs index 55565c7b9e..c2a6af8122 100644 --- a/src/lit.rs +++ b/src/lit.rs @@ -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"`. diff --git a/src/pat.rs b/src/pat.rs index 1e95adb8ed..c029bae838 100644 --- a/src/pat.rs +++ b/src/pat.rs @@ -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 { diff --git a/src/restriction.rs b/src/restriction.rs index 8634607c76..70d2853f6c 100644 --- a/src/restriction.rs +++ b/src/restriction.rs @@ -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`. diff --git a/src/ty.rs b/src/ty.rs index 50aaafb148..55c313979b 100644 --- a/src/ty.rs +++ b/src/ty.rs @@ -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 {