Skip to content

Commit dc8fec2

Browse files
committed
Update rustdoc
1 parent 96404ee commit dc8fec2

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/librustdoc/config.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,11 @@ impl Options {
254254
(instead was `{}`)", arg));
255255
}
256256
};
257+
// FIXME: deduplicate this code from the identical code in librustc/session/config.rs
257258
let error_format = match matches.opt_str("error-format").as_ref().map(|s| &s[..]) {
258259
Some("human") => ErrorOutputType::HumanReadable(color),
259-
Some("json") => ErrorOutputType::Json(false),
260-
Some("pretty-json") => ErrorOutputType::Json(true),
260+
Some("json") => ErrorOutputType::Json { pretty: false, colorful_rendered: false },
261+
Some("pretty-json") => ErrorOutputType::Json { pretty: true, colorful_rendered: false },
261262
Some("short") => ErrorOutputType::Short(color),
262263
None => ErrorOutputType::HumanReadable(color),
263264
Some(arg) => {

src/librustdoc/core.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,15 @@ pub fn new_handler(error_format: ErrorOutputType,
307307
sessopts.debugging_opts.teach,
308308
).ui_testing(ui_testing)
309309
),
310-
ErrorOutputType::Json(pretty) => {
310+
ErrorOutputType::Json { pretty, colorful_rendered } => {
311311
let source_map = source_map.unwrap_or_else(
312312
|| Lrc::new(source_map::SourceMap::new(sessopts.file_path_mapping())));
313313
Box::new(
314314
JsonEmitter::stderr(
315315
None,
316316
source_map,
317317
pretty,
318+
colorful_rendered,
318319
).ui_testing(ui_testing)
319320
)
320321
},

src/librustdoc/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ pub fn make_test(s: &str,
381381
// Any errors in parsing should also appear when the doctest is compiled for real, so just
382382
// send all the errors that libsyntax emits directly into a `Sink` instead of stderr.
383383
let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
384-
let emitter = EmitterWriter::new(box io::sink(), None, false, false);
384+
let emitter = EmitterWriter::new(box io::sink(), None, false, false, false);
385385
let handler = Handler::with_emitter(false, None, box emitter);
386386
let sess = ParseSess::with_span_handler(handler, cm);
387387

0 commit comments

Comments
 (0)