about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-27 08:03:17 +0000
committerbors <bors@rust-lang.org>2024-06-27 08:03:17 +0000
commitb280af45f430d1efc85d7e4fcc4933d4ec9f94b2 (patch)
tree8dd2cf6a454a8d2a3d3d3f456e7c36361eb9f09e /compiler/rustc_errors/src
parentfc94ce216ede9f89a1032b13e2563ddba0ae4194 (diff)
parent4cc16a53aeea6b82d05e665cb4bcbcddb1e2d7be (diff)
downloadrust-b280af45f430d1efc85d7e4fcc4933d4ec9f94b2.tar.gz
rust-b280af45f430d1efc85d7e4fcc4933d4ec9f94b2.zip
Auto merge of #3713 - rust-lang:rustup-2024-06-27, r=RalfJung
Automatic Rustup
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/json.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs
index af82d8092c2..764134d5335 100644
--- a/compiler/rustc_errors/src/json.rs
+++ b/compiler/rustc_errors/src/json.rs
@@ -135,7 +135,12 @@ impl Emitter for JsonEmitter {
         let data: Vec<FutureBreakageItem<'_>> = diags
             .into_iter()
             .map(|mut diag| {
-                if diag.level == crate::Level::Allow {
+                // Allowed or expected lints don't normally (by definition) emit a lint
+                // but future incompat lints are special and are emitted anyway.
+                //
+                // So to avoid ICEs and confused users we "upgrade" the lint level for
+                // those `FutureBreakageItem` to warn.
+                if matches!(diag.level, crate::Level::Allow | crate::Level::Expect(..)) {
                     diag.level = crate::Level::Warning;
                 }
                 FutureBreakageItem {