From b65bad99f7e9c7c2d9a19a54ff385146f522082c Mon Sep 17 00:00:00 2001 From: Spencer Imbleau Date: Wed, 12 May 2021 09:02:13 -0400 Subject: [PATCH 1/4] Clarified the attribute which prompts the warning The example call was lacking clarification of the `#![warn(rustdoc::invalid_codeblock_attributes)]` attribute which generates the specified warning. --- src/doc/rustdoc/src/lints.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index a6626679a7d60..c494eef1b5705 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -227,6 +227,8 @@ This lint **warns by default**. It detects code block attributes in documentation examples that have potentially mis-typed values. For example: ```rust +#![warn(rustdoc::invalid_codeblock_attributes)] + /// Example. /// /// ```should-panic From 2b27c82fbb691f6b2d3440535a13780fdf36ee23 Mon Sep 17 00:00:00 2001 From: Spencer Imbleau Date: Wed, 12 May 2021 09:52:28 -0400 Subject: [PATCH 2/4] Clarified all attributes which prompt warnings All calls which trigger rustdoc warnings and are now properly verbose for consistency. This uses the attribute in the examples which provides the user with more context. --- src/doc/rustdoc/src/lints.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index c494eef1b5705..dddff0475ad5c 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -70,6 +70,8 @@ This lint **warns by default**. This lint detects when [intra-doc links] from pu For example: ```rust +#![warn(private_intra_doc_links)] + /// [private] pub fn public() {} fn private() {} @@ -302,6 +304,8 @@ This lint is **warn-by-default**. It detects URLs which are not links. For example: ```rust +#![warn(bare_urls)] + /// http://example.org /// [http://example.net] pub fn foo() {} From d7884d4b08f0eedbdc6a3dabd0fdaa3779d393b6 Mon Sep 17 00:00:00 2001 From: Spencer Imbleau Date: Sun, 16 May 2021 12:54:53 -0400 Subject: [PATCH 3/4] Noted necessessity and fixed rustdoc:: prefix Now shows that certain warnings are unnecessary but includes them for consistency. --- src/doc/rustdoc/src/lints.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index dddff0475ad5c..a496db600ef93 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -70,7 +70,7 @@ This lint **warns by default**. This lint detects when [intra-doc links] from pu For example: ```rust -#![warn(private_intra_doc_links)] +#![warn(rustdoc::private_intra_doc_links)] // note: unecessary - warns by default. /// [private] pub fn public() {} @@ -112,7 +112,7 @@ This lint is **allowed by default**. It detects items missing documentation. For example: ```rust -#![warn(missing_docs)] +#![warn(rustdoc::missing_docs)] pub fn undocumented() {} # fn main() {} @@ -229,7 +229,7 @@ This lint **warns by default**. It detects code block attributes in documentation examples that have potentially mis-typed values. For example: ```rust -#![warn(rustdoc::invalid_codeblock_attributes)] +#![warn(rustdoc::invalid_codeblock_attributes)] // note: unecessary - warns by default. /// Example. /// @@ -304,7 +304,7 @@ This lint is **warn-by-default**. It detects URLs which are not links. For example: ```rust -#![warn(bare_urls)] +#![warn(rustdoc::bare_urls)] // note: unecessary - warns by default. /// http://example.org /// [http://example.net] From 8a7bb2bb66f86f2e106b85145eae824f84da2419 Mon Sep 17 00:00:00 2001 From: Spencer Imbleau Date: Sun, 16 May 2021 12:58:52 -0400 Subject: [PATCH 4/4] Fixed item typo which did not need prefix --- src/doc/rustdoc/src/lints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index a496db600ef93..1c85ee0eeb553 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -112,7 +112,7 @@ This lint is **allowed by default**. It detects items missing documentation. For example: ```rust -#![warn(rustdoc::missing_docs)] +#![warn(missing_docs)] pub fn undocumented() {} # fn main() {}