summary refs log tree commit diff
path: root/compiler/rustc_session/src
diff options
context:
space:
mode:
authorFabian Wolff <fabian.wolff@alumni.ethz.ch>2021-10-02 19:15:45 +0200
committerFabian Wolff <fabian.wolff@alumni.ethz.ch>2021-10-02 19:15:55 +0200
commit041212f8fbb9f52d41167448e4fbc2ce8cc7ee9a (patch)
treec13075331c74e7e216d5769ad0f2efa6984b60ec /compiler/rustc_session/src
parented937594d3912ced11f6f35a90bb8bf591909d2a (diff)
downloadrust-041212f8fbb9f52d41167448e4fbc2ce8cc7ee9a.tar.gz
rust-041212f8fbb9f52d41167448e4fbc2ce8cc7ee9a.zip
Report fatal lexer errors in `--cfg` command line arguments
Diffstat (limited to 'compiler/rustc_session/src')
-rw-r--r--compiler/rustc_session/src/parse.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs
index a007b530302..f7246641dca 100644
--- a/compiler/rustc_session/src/parse.rs
+++ b/compiler/rustc_session/src/parse.rs
@@ -174,9 +174,14 @@ impl ParseSess {
         }
     }
 
-    pub fn with_silent_emitter() -> Self {
+    pub fn with_silent_emitter(fatal_note: Option<String>) -> Self {
         let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
-        let handler = Handler::with_emitter(false, None, Box::new(SilentEmitter));
+        let fatal_handler = Handler::with_tty_emitter(ColorConfig::Auto, false, None, None);
+        let handler = Handler::with_emitter(
+            false,
+            None,
+            Box::new(SilentEmitter { fatal_handler, fatal_note }),
+        );
         ParseSess::with_span_handler(handler, sm)
     }