-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
#13016 added the following hack to accommodate rust-lang/rust#115691, because for now, some compilers supported by Cargo emit "$message_type" in their diagnostics and some do not.
cargo/crates/cargo-test-support/src/compare.rs
Lines 597 to 607 in 71cd3a9
// Compilers older than 1.76 do not produce $message_type. | |
// Treat it as optional for now. | |
let mut expected_entries_without_message_type; | |
let expected_entries: &mut dyn Iterator<Item = _> = | |
if l.contains_key("$message_type") && !r.contains_key("$message_type") { | |
expected_entries_without_message_type = | |
expected_entries.filter(|entry| entry.0 != "$message_type"); | |
&mut expected_entries_without_message_type | |
} else { | |
&mut expected_entries | |
}; |
As soon as Cargo's MSRV increases past 1.76, this should be deleted.
According to @epage, the JSON testing infrastructure is intended to be independent of rustc in the long term. Compiler-specific special cases run counter to this effort to switch to a generic third-party library.
Of course deleting the special case only defers the issue until some other JSON change happens in a future release. We still need to figure out how the generic tool should accommodate this in a principled way.
Activity
$message_type
#13424