Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change printing of "
--error-format
is unstable" errors.
Currently for these two errors we go to the effort of switching to a standard JSON emitter, for no obvious reason, and unlike any other errors. This behaviour was added for `pretty-json` in rust-lang#45737, and then `human-annotate-rs` copied it some time later when it was added. This commit changes things to just using the requested emitter, which is simpler and consistent with other errors. Old output: ``` $ rustc --error-format pretty-json {"$message_type":"diagnostic","message":"`--error-format=pretty-json` is unstable","code":null,"level":"error","spans":[],"children":[],"rendered":"error: `--error-format=pretty-json` is unstable\n\n"} $ rustc --error-format human-annotate-rs {"$message_type":"diagnostic","message":"`--error-format=human-annotate-rs` is unstable","code":null,"level":"error","spans":[],"children":[],"rendered":"error: `--error-format=human-annotate-rs` is unstable\n\n"} ``` New output: ``` $ rustc --error-format pretty-json { "$message_type": "diagnostic", "message": "`--error-format=pretty-json` is unstable", "code": null, "level": "error", "spans": [], "children": [], "rendered": "error: `--error-format=pretty-json` is unstable\n\n" } $ rustc --error-format human-annotate-rs error: `--error-format=human-annotate-rs` is unstable ```
- Loading branch information