about summary refs log tree commit diff
path: root/compiler/rustc_lint
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-10-20 16:34:35 +0000
committerbors <bors@rust-lang.org>2024-10-20 16:34:35 +0000
commitde977a5acf210f7d71ff83f4b8bc42c274ce4ed9 (patch)
tree0a0c48eb9dd8db5f171db1c74d9c09e6891d878c /compiler/rustc_lint
parentbfab34af4c5bfbcc9168064857bbec826a60a0b9 (diff)
parenta860657c0404dfe3297498176b21933836bd3358 (diff)
Auto merge of #131970 - matthiaskrgr:rollup-nr32ksd, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #121560 (Allow `#[deny]` inside `#[forbid]` as a no-op)
 - #131365 (Fix missing rustfmt in msi installer #101993)
 - #131647 (Register `src/tools/unicode-table-generator` as a runnable tool)
 - #131843 (compiler: Error on layout of enums with invalid reprs)
 - #131926 (Align boolean option descriptions in `configure.py`)
 - #131961 (compiletest: tidy up how `tidy` and `tidy` (html version) are disambiguated)
 - #131962 (Make `llvm::set_section` take a `&CStr`)
 - #131964 (add latest crash tests)
 - #131965 (remove outdated comment)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/src/levels.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs
index 89a67fc0d89..95a8e7625ff 100644
--- a/compiler/rustc_lint/src/levels.rs
+++ b/compiler/rustc_lint/src/levels.rs
@@ -493,7 +493,10 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
         //
         // This means that this only errors if we're truly lowering the lint
         // level from forbid.
-        if self.lint_added_lints && level != Level::Forbid && old_level == Level::Forbid {
+        if self.lint_added_lints && level == Level::Deny && old_level == Level::Forbid {
+            // Having a deny inside a forbid is fine and is ignored, so we skip this check.
+            return;
+        } else if self.lint_added_lints && level != Level::Forbid && old_level == Level::Forbid {
             // Backwards compatibility check:
             //
             // We used to not consider `forbid(lint_group)`