diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-25 10:27:34 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-25 13:51:15 +0000 |
| commit | 2b444672e10d1a019c194729b9e4800d39904459 (patch) | |
| tree | 7ff447565fc8c7c9a3a673b974db6b6dc2686066 /compiler/rustc_session/src/parse.rs | |
| parent | cf9f53c83753e64d4e56fd188fa93ee8b49bf32b (diff) | |
Use a builder instead of boolean/option arguments
Diffstat (limited to 'compiler/rustc_session/src/parse.rs')
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 060d5c96665..bca49981668 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -224,7 +224,7 @@ impl ParseSess { pub fn new(locale_resources: Vec<&'static str>, file_path_mapping: FilePathMapping) -> Self { let fallback_bundle = fallback_fluent_bundle(locale_resources, false); let sm = Lrc::new(SourceMap::new(file_path_mapping)); - let handler = Handler::with_tty_emitter(true, Some(sm.clone()), fallback_bundle); + let handler = Handler::with_tty_emitter(Some(sm.clone()), fallback_bundle); ParseSess::with_span_handler(handler, sm) } @@ -254,13 +254,9 @@ impl ParseSess { pub fn with_silent_emitter(fatal_note: Option<String>) -> Self { let fallback_bundle = fallback_fluent_bundle(Vec::new(), false); let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); - let fatal_handler = Handler::with_tty_emitter(false, None, fallback_bundle); - let handler = Handler::with_emitter( - false, - None, - Box::new(SilentEmitter { fatal_handler, fatal_note }), - None, - ); + let fatal_handler = Handler::with_tty_emitter(None, fallback_bundle).disable_warnings(); + let handler = Handler::with_emitter(Box::new(SilentEmitter { fatal_handler, fatal_note })) + .disable_warnings(); ParseSess::with_span_handler(handler, sm) } |
