about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJules Bertholet <julesbertholet@quoi.xyz>2023-10-29 23:26:01 -0400
committerJonas Platte <jplatte+git@posteo.de>2025-07-23 00:10:58 +0200
commitacb0e71c49135741f6e48c7cfb16e8b41c2235f1 (patch)
tree283e8eb54f3a1de6a6286c0ea11f8662ba251732
parent2e5367566819ca7878baa9600ae7a93eb0e37bbf (diff)
downloadrust-acb0e71c49135741f6e48c7cfb16e8b41c2235f1.tar.gz
rust-acb0e71c49135741f6e48c7cfb16e8b41c2235f1.zip
Make lints work with `allow_internal_unstable`
-rw-r--r--compiler/rustc_lint/src/levels.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs
index 16eeb89207b..ac47897b568 100644
--- a/compiler/rustc_lint/src/levels.rs
+++ b/compiler/rustc_lint/src/levels.rs
@@ -933,6 +933,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
     fn check_gated_lint(&self, lint_id: LintId, span: Span, lint_from_cli: bool) -> bool {
         let feature = if let Some(feature) = lint_id.lint.feature_gate
             && !self.features.enabled(feature)
+            && !span.allows_unstable(feature)
         {
             // Lint is behind a feature that is not enabled; eventually return false.
             feature