Add note about caveat for cfg(doc)
For example, we definitely wouldn't want to do this in libcore.
This commit is contained in:
parent
8298da72e7
commit
943c3bc3db
1 changed files with 6 additions and 2 deletions
|
@ -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)`"
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue