-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Open
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Code
// - have at least one doctest, and
//
// - at the top of lib.rs `forbid` any of the `allow` that rustdoc injects by default. For example
#![doc(test(attr(forbid(unused, dead_code))))]Reproduction Steps
cargo test
...
warning: allow(unused_extern_crates) incompatible with previous forbid
--> src/lib.rs:16:9
|
1 | #![forbid(unused, dead_code)]
| ------ `forbid` level set here
2 | #[allow(unused_extern_crates)]
| ^^^^^^^^^^^^^^^^^^^^ overruled by previous forbid
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
= note: `#[warn(forbidden_lint_groups)]` (part of `#[warn(future_incompatible)]`) on by default
Version
rustdoc 1.91.0 (f8297e351 2025-10-28)
installed with rustup, standard x64 Linux
Suggestions
Please,
- provide a configuration for
rustdocNOT to inject the default#[allow(...)]. If there already exists such a configuration, please document - I couldn't see it obvious anywhere at https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html. Or - document which exact lints are injected, so that the author/doc writer can
#[allow(...)]them individually, instead of using a group lint.
Related to #81670.
Metadata
Metadata
Assignees
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Projects
Status
No status