diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-29 16:03:59 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-29 17:50:26 +1100 |
| commit | 9ff4487999ccd02065ec56fdc8cee665feae9680 (patch) | |
| tree | 37a6eb3f8c29c6e3979ef764eb8baa7336f83db3 /compiler/rustc_session/src | |
| parent | 2999d8dc72e9ed9e895d6a9e2d3d34f1cd4370ba (diff) | |
| download | rust-9ff4487999ccd02065ec56fdc8cee665feae9680.tar.gz rust-9ff4487999ccd02065ec56fdc8cee665feae9680.zip | |
Make `JsonEmitter` more like `HumanEmitter`.
Use `derive(Setters)` to derive setters, and then change `JsonEmitter::new` to only have the arguments that are always used.
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 2979d880dbd..09fb6aa5d8f 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1001,21 +1001,21 @@ fn default_emitter( config::ErrorOutputType::Json { pretty, json_rendered } => Box::new( JsonEmitter::new( Box::new(io::BufWriter::new(io::stderr())), - Some(registry), source_map, - bundle, fallback_bundle, pretty, json_rendered, - sopts.diagnostic_width, - macro_backtrace, - track_diagnostics, - terminal_url, ) + .registry(Some(registry)) + .fluent_bundle(bundle) .ui_testing(sopts.unstable_opts.ui_testing) .ignored_directories_in_source_blocks( sopts.unstable_opts.ignore_directory_in_diagnostics_source_blocks.clone(), - ), + ) + .diagnostic_width(sopts.diagnostic_width) + .macro_backtrace(macro_backtrace) + .track_diagnostics(track_diagnostics) + .terminal_url(terminal_url), ), } } @@ -1482,16 +1482,10 @@ fn mk_emitter(output: ErrorOutputType) -> Box<DynEmitter> { } config::ErrorOutputType::Json { pretty, json_rendered } => Box::new(JsonEmitter::new( Box::new(io::BufWriter::new(io::stderr())), - None, Lrc::new(SourceMap::new(FilePathMapping::empty())), - None, fallback_bundle, pretty, json_rendered, - None, - false, - false, - TerminalUrl::No, )), }; emitter |
