From fbd548acc3120bc7790f96134b7d6da5236933fd Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Fri, 30 Dec 2022 17:09:19 -0800 Subject: 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. --- src/librustdoc/lint.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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(); -- cgit 1.4.1-3-g733a5