You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in both stable (1.66.0) and nightly (2381cbdb4 2022-12-23), using rustdoc::all will trigger unknown_lints:
warning: unknown lint: `rustdoc::missing_doc_code_examples`
--> src/lib.rs:5:18
|
5 | #![cfg_attr(doc, warn(rustdoc::all))]
| ^^^^^^^^^^^^^^^^^^
|
= note: the `rustdoc::missing_doc_code_examples` lint is unstable
= note: see issue #101730 <https://github.com/rust-lang/rust/issues/101730> for more information
= note: `#[warn(unknown_lints)]` on by default
Expected behavior
The expected behavior would be that a stable lint group shouldn't use unstable lints unless the unstable feature is active.
Problem
The current behavior is weird because you can't make the warning go away without using allow(unknown_lints) or enabling the unstable feature and using allow(rustdoc::missing_doc_code_examples).
This broke CIs on multiple occasions that have simply been using RUSTDOCFLAGS=-Dwarnings cargo doc.
Current Workaround
Currently the workaround fix is: #![cfg_attr(doc, allow(unknown_lints), warn(rustdoc::all))].
Including unstable lints in the lint group produces unintuitive behavior
on stable (see rust-lang#106289). Meanwhile, if we only included unstable lints
on nightly and not on stable, we could end up with confusing bugs that
were hard to compare across versions of Rust that lacked code changes.
I think that only including stable lints in `rustdoc::all`, no matter
the release channel, is the most intuitive option. Users can then
control unstable lints individually, which is reasonable since they have
to enable the feature gates individually anyway.
Current behavior
Currently, in both stable (
1.66.0
) and nightly (2381cbdb4 2022-12-23
), usingrustdoc::all
will triggerunknown_lints
:Expected behavior
The expected behavior would be that a stable lint group shouldn't use unstable lints unless the unstable feature is active.
Problem
The current behavior is weird because you can't make the warning go away without using
allow(unknown_lints)
or enabling the unstable feature and usingallow(rustdoc::missing_doc_code_examples)
.This broke CIs on multiple occasions that have simply been using
RUSTDOCFLAGS=-Dwarnings cargo doc
.Current Workaround
Currently the workaround fix is:
#![cfg_attr(doc, allow(unknown_lints), warn(rustdoc::all))]
.Tested Versions
Stable:
Nightly:
The text was updated successfully, but these errors were encountered: