about summary refs log tree commit diff
path: root/src/librustdoc/lint.rs
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2022-12-30 17:09:19 -0800
committerNoah Lev <camelidcamel@gmail.com>2023-02-19 22:05:58 -0800
commitfbd548acc3120bc7790f96134b7d6da5236933fd (patch)
tree73eb5f7af6e0b2425b4615f2c342935dfe815558 /src/librustdoc/lint.rs
parent7b552967b8ed122aa949cddac8c2270b6490e64e (diff)
downloadrust-fbd548acc3120bc7790f96134b7d6da5236933fd.tar.gz
rust-fbd548acc3120bc7790f96134b7d6da5236933fd.zip
Only include stable lints in `rustdoc::all` group
Including unstable lints in the lint group produces unintuitive behavior
on stable (see #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.
Diffstat (limited to 'src/librustdoc/lint.rs')
-rw-r--r--src/librustdoc/lint.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/lint.rs b/src/librustdoc/lint.rs
index 3aad97bc296..6d289eb996d 100644
--- a/src/librustdoc/lint.rs
+++ b/src/librustdoc/lint.rs
@@ -194,7 +194,11 @@ pub(crate) fn register_lints(_sess: &Session, lint_store: &mut LintStore) {
         true,
         "rustdoc::all",
         Some("rustdoc"),
-        RUSTDOC_LINTS.iter().map(|&lint| LintId::of(lint)).collect(),
+        RUSTDOC_LINTS
+            .iter()
+            .filter(|lint| lint.feature_gate.is_none()) // only include stable lints
+            .map(|&lint| LintId::of(lint))
+            .collect(),
     );
     for lint in &*RUSTDOC_LINTS {
         let name = lint.name_lower();