(instead was `{}`)", arg));
}
};
+ // FIXME: deduplicate this code from the identical code in librustc/session/config.rs
let error_format = match matches.opt_str("error-format").as_ref().map(|s| &s[..]) {
Some("human") => ErrorOutputType::HumanReadable(color),
- Some("json") => ErrorOutputType::Json(false),
- Some("pretty-json") => ErrorOutputType::Json(true),
+ Some("json") => ErrorOutputType::Json { pretty: false, colorful_rendered: false },
+ Some("pretty-json") => ErrorOutputType::Json { pretty: true, colorful_rendered: false },
Some("short") => ErrorOutputType::Short(color),
None => ErrorOutputType::HumanReadable(color),
Some(arg) => {
sessopts.debugging_opts.teach,
).ui_testing(ui_testing)
),
- ErrorOutputType::Json(pretty) => {
+ ErrorOutputType::Json { pretty, colorful_rendered } => {
let source_map = source_map.unwrap_or_else(
|| Lrc::new(source_map::SourceMap::new(sessopts.file_path_mapping())));
Box::new(
None,
source_map,
pretty,
+ colorful_rendered,
).ui_testing(ui_testing)
)
},
// Any errors in parsing should also appear when the doctest is compiled for real, so just
// send all the errors that libsyntax emits directly into a `Sink` instead of stderr.
let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
- let emitter = EmitterWriter::new(box io::sink(), None, false, false);
+ let emitter = EmitterWriter::new(box io::sink(), None, false, false, false);
let handler = Handler::with_emitter(false, None, box emitter);
let sess = ParseSess::with_span_handler(handler, cm);