]> git.lizzy.rs Git - rust.git/commitdiff
Update rustdoc
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 12 Mar 2019 13:47:45 +0000 (14:47 +0100)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 2 Apr 2019 14:14:58 +0000 (16:14 +0200)
src/librustdoc/config.rs
src/librustdoc/core.rs
src/librustdoc/test.rs

index f2682e00430d08fb3aadd79afc136e7377668cac..af5c95ea589966cb1389219d9d6f7d90a66fa5c9 100644 (file)
@@ -254,10 +254,11 @@ pub fn from_matches(matches: &getopts::Matches) -> Result<Options, i32> {
                                       (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) => {
index 3cf6b32b07c4c0868d6a22e3e053cdd6607f2f8b..18bb5eef538badc620c8753ec0ec9ad6aedfc397 100644 (file)
@@ -307,7 +307,7 @@ pub fn new_handler(error_format: ErrorOutputType,
                 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(
@@ -315,6 +315,7 @@ pub fn new_handler(error_format: ErrorOutputType,
                     None,
                     source_map,
                     pretty,
+                    colorful_rendered,
                 ).ui_testing(ui_testing)
             )
         },
index 0bbc7c5c4b223396a0bddd2301c2a43b8726e2a6..abf74158c938e4b0b8f65f6dd9646ece7e517510 100644 (file)
@@ -381,7 +381,7 @@ pub fn make_test(s: &str,
         // 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);