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

Delete "$message_type" special case from with_json_contains_unordered #13017

Closed
dtolnay opened this issue Nov 20, 2023 · 0 comments · Fixed by #13424
Closed

Delete "$message_type" special case from with_json_contains_unordered #13017

dtolnay opened this issue Nov 20, 2023 · 0 comments · Fixed by #13424
Labels
A-testing-cargo-itself Area: cargo's tests S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

Comments

@dtolnay
Copy link
Member

dtolnay commented Nov 20, 2023

#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.

// 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.

@dtolnay dtolnay added the C-tracking-issue Category: A tracking issue for something unstable. label Nov 20, 2023
@ehuss ehuss added S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix A-testing-cargo-itself Area: cargo's tests and removed C-tracking-issue Category: A tracking issue for something unstable. labels Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing-cargo-itself Area: cargo's tests S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants