Skip to content

Commit 479e1fc

Browse files
authored
Add note about caveat for cfg(doc) (#13724)
For example, we definitely wouldn't want to do this in libcore. changelog: none
2 parents 8298da7 + 418dfb2 commit 479e1fc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

clippy_lints/src/doc/mod.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,17 @@ declare_clippy_lint! {
539539
/// ### What it does
540540
/// Checks if included files in doc comments are included only for `cfg(doc)`.
541541
///
542-
/// ### Why is this bad?
542+
/// ### Why restrict this?
543543
/// These files are not useful for compilation but will still be included.
544544
/// Also, if any of these non-source code file is updated, it will trigger a
545545
/// recompilation.
546546
///
547+
/// ### Known problems
548+
///
549+
/// Excluding this will currently result in the file being left out if
550+
/// the item's docs are inlined from another crate. This may be fixed in a
551+
/// future version of rustdoc.
552+
///
547553
/// ### Example
548554
/// ```ignore
549555
/// #![doc = include_str!("some_file.md")]
@@ -554,7 +560,7 @@ declare_clippy_lint! {
554560
/// ```
555561
#[clippy::version = "1.84.0"]
556562
pub DOC_INCLUDE_WITHOUT_CFG,
557-
pedantic,
563+
restriction,
558564
"check if files included in documentation are behind `cfg(doc)`"
559565
}
560566

0 commit comments

Comments
 (0)