diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-11-12 22:32:42 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-11-17 10:33:14 +0100 |
| commit | 95ee1fc7ea5c60fabb996fe9c18c535e3c947d0f (patch) | |
| tree | e2b17c4e923688d1407abb32d0378f59a76e331a /src | |
| parent | fd4a33cbbe635bedd25fc36247246f1bcea5dba7 (diff) | |
| download | rust-95ee1fc7ea5c60fabb996fe9c18c535e3c947d0f.tar.gz rust-95ee1fc7ea5c60fabb996fe9c18c535e3c947d0f.zip | |
Correctly detect color support
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/doctest.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 8ac24fdc8af..3f62dead33a 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -428,11 +428,13 @@ crate fn make_test( // Any errors in parsing should also appear when the doctest is compiled for real, so just // send all the errors that librustc_ast emits directly into a `Sink` instead of stderr. let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); + supports_color = + EmitterWriter::stderr(ColorConfig::Auto, None, false, false, Some(80), false) + .supports_color(); + let emitter = EmitterWriter::new(box io::sink(), None, false, false, false, None, false); - supports_color = emitter.supports_color(); - // FIXME(misdreavus): pass `-Z treat-err-as-bug` to the doctest parser let handler = Handler::with_emitter(false, None, box emitter); let sess = ParseSess::with_span_handler(handler, sm); |
