Skip to content

Commit

Permalink
Unbreak tests/ui/lint/use_suggestion_json.rs.
Browse files Browse the repository at this point in the history
PR rust-lang#82639 changed UI tests so `-Z unstable-options` aren't passed to UI
tests by default. This completely broke `use_suggestion_json.rs`, which
uses the unstable `--error-format=pretty-json` option. The expected
output went from 400 lines of pretty JSON error messages to a single
JSON error saying "`--error-format=pretty-json` is unstable"!

This commit adds `-Z unstable-options` back and reinstates the old
expected output, with some minor changes to account for shifted spans
and slightly JSON output changes since then.
  • Loading branch information
nnethercote committed Jan 5, 2024
1 parent 453ffac commit f5a09a9
Show file tree
Hide file tree
Showing 2 changed files with 423 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/ui/lint/use_suggestion_json.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ignore-windows
// ignore-sgx std::os::fortanix_sgx::usercalls::alloc::Iter changes compiler suggestions
// compile-flags: --error-format pretty-json --json=diagnostic-rendered-ansi
// compile-flags: --error-format pretty-json --json=diagnostic-rendered-ansi -Z unstable-options

// The output for humans should just highlight the whole span without showing
// the suggested replacement, but we also want to test that suggested
Expand Down
Loading

0 comments on commit f5a09a9

Please sign in to comment.