about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-11-23 17:10:08 -0700
committerGitHub <noreply@github.com>2024-11-23 17:10:08 -0700
commit943c3bc3db590b8549f76eee814bef58b68a37f8 (patch)
tree1ed0ac1cc03a16b4a0ff205183ab1a88e9a7f1c0
parent8298da72e7b81fa30c515631b40fc4c0845948cb (diff)
downloadrust-943c3bc3db590b8549f76eee814bef58b68a37f8.tar.gz
rust-943c3bc3db590b8549f76eee814bef58b68a37f8.zip
Add note about caveat for `cfg(doc)`
For example, we definitely wouldn't want to do this in libcore.
-rw-r--r--clippy_lints/src/doc/mod.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/clippy_lints/src/doc/mod.rs b/clippy_lints/src/doc/mod.rs
index fd6ae21a5f8..993335e8248 100644
--- a/clippy_lints/src/doc/mod.rs
+++ b/clippy_lints/src/doc/mod.rs
@@ -539,11 +539,15 @@ declare_clippy_lint! {
     /// ### What it does
     /// Checks if included files in doc comments are included only for `cfg(doc)`.
     ///
-    /// ### Why is this bad?
+    /// ### Why restrict this?
     /// These files are not useful for compilation but will still be included.
     /// Also, if any of these non-source code file is updated, it will trigger a
     /// recompilation.
     ///
+    /// Excluding this will currently result in the file being left out if
+    /// the item's docs are inlined from another crate. This may be fixed in a
+    /// future version of rustdoc.
+    ///
     /// ### Example
     /// ```ignore
     /// #![doc = include_str!("some_file.md")]
@@ -554,7 +558,7 @@ declare_clippy_lint! {
     /// ```
     #[clippy::version = "1.84.0"]
     pub DOC_INCLUDE_WITHOUT_CFG,
-    pedantic,
+    restriction,
     "check if files included in documentation are behind `cfg(doc)`"
 }