diff options
| author | Fabian Wolff <fabian.wolff@alumni.ethz.ch> | 2021-10-02 19:15:45 +0200 |
|---|---|---|
| committer | Fabian Wolff <fabian.wolff@alumni.ethz.ch> | 2021-10-02 19:15:55 +0200 |
| commit | 041212f8fbb9f52d41167448e4fbc2ce8cc7ee9a (patch) | |
| tree | c13075331c74e7e216d5769ad0f2efa6984b60ec /compiler/rustc_interface/src | |
| parent | ed937594d3912ced11f6f35a90bb8bf591909d2a (diff) | |
| download | rust-041212f8fbb9f52d41167448e4fbc2ce8cc7ee9a.tar.gz rust-041212f8fbb9f52d41167448e4fbc2ce8cc7ee9a.zip | |
Report fatal lexer errors in `--cfg` command line arguments
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 8393826aa12..3233887169c 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -81,7 +81,10 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String let cfg = cfgspecs .into_iter() .map(|s| { - let sess = ParseSess::with_silent_emitter(); + let sess = ParseSess::with_silent_emitter(Some(format!( + "this error occurred on the command line: `--cfg={}`", + s + ))); let filename = FileName::cfg_spec_source_code(&s); let mut parser = new_parser_from_source_str(&sess, filename, s.to_string()); |
