Prevent ICE from expected future breakage
This commit is contained in:
parent
b124b3666e
commit
1d667a0937
3 changed files with 69 additions and 20 deletions
|
@ -135,7 +135,12 @@ impl Emitter for JsonEmitter {
|
|||
let data: Vec<FutureBreakageItem<'_>> = diags
|
||||
.into_iter()
|
||||
.map(|mut diag| {
|
||||
if diag.level == crate::Level::Allow {
|
||||
// The `FutureBreakageItem` is collected and serialized.
|
||||
// However, the `allow` and `expect` lint levels can't usually
|
||||
// be serialized. The lint level is overwritten to allow the
|
||||
// serialization again and force a lint emission.
|
||||
// (This is an educated guess. I didn't originally add this)
|
||||
if matches!(diag.level, crate::Level::Allow | crate::Level::Expect(..)) {
|
||||
diag.level = crate::Level::Warning;
|
||||
}
|
||||
FutureBreakageItem {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue