Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test-support): remove special case for $message_type #13424

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions crates/cargo-test-support/src/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,18 +596,6 @@ fn find_json_mismatch_r<'a>(
let mut expected_entries = l.iter();
let mut actual_entries = r.iter();

// 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
};

loop {
match (expected_entries.next(), actual_entries.next()) {
(None, None) => return None,
Expand Down