Skip to content

Commit 7666534

Browse files
authoredJun 26, 2024
Clarify comment on changing to warn future breakage items
https://github.com/rust-lang/rust/pull/120924/files#r1653512240
1 parent 1d667a0 commit 7666534

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎compiler/rustc_errors/src/json.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ impl Emitter for JsonEmitter {
135135
let data: Vec<FutureBreakageItem<'_>> = diags
136136
.into_iter()
137137
.map(|mut diag| {
138-
// The `FutureBreakageItem` is collected and serialized.
139-
// However, the `allow` and `expect` lint levels can't usually
140-
// be serialized. The lint level is overwritten to allow the
141-
// serialization again and force a lint emission.
142-
// (This is an educated guess. I didn't originally add this)
138+
// Allowed or expected lints don't normally (by definition) emit a lint
139+
// but future incompat lints are special and are emitted anyway.
140+
//
141+
// So to avoid ICEs and confused users we "upgrade" the lint level for
142+
// those `FutureBreakageItem` to warn.
143143
if matches!(diag.level, crate::Level::Allow | crate::Level::Expect(..)) {
144144
diag.level = crate::Level::Warning;
145145
}

0 commit comments

Comments
 (0)
Please sign in to comment.