Clarify comment on changing to warn future breakage items
https://github.com/rust-lang/rust/pull/120924/files#r1653512240
This commit is contained in:
parent
1d667a0937
commit
7666534381
1 changed files with 5 additions and 5 deletions
|
@ -135,11 +135,11 @@ impl Emitter for JsonEmitter {
|
||||||
let data: Vec<FutureBreakageItem<'_>> = diags
|
let data: Vec<FutureBreakageItem<'_>> = diags
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|mut diag| {
|
.map(|mut diag| {
|
||||||
// The `FutureBreakageItem` is collected and serialized.
|
// Allowed or expected lints don't normally (by definition) emit a lint
|
||||||
// However, the `allow` and `expect` lint levels can't usually
|
// but future incompat lints are special and are emitted anyway.
|
||||||
// be serialized. The lint level is overwritten to allow the
|
//
|
||||||
// serialization again and force a lint emission.
|
// So to avoid ICEs and confused users we "upgrade" the lint level for
|
||||||
// (This is an educated guess. I didn't originally add this)
|
// those `FutureBreakageItem` to warn.
|
||||||
if matches!(diag.level, crate::Level::Allow | crate::Level::Expect(..)) {
|
if matches!(diag.level, crate::Level::Allow | crate::Level::Expect(..)) {
|
||||||
diag.level = crate::Level::Warning;
|
diag.level = crate::Level::Warning;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue