SilentEmitter::fatal_note doesn't need to be optional.

This commit is contained in:
Nicholas Nethercote 2024-02-01 19:18:25 +11:00
parent a9a2e1565a
commit 8ba25d0989
3 changed files with 11 additions and 13 deletions

View file

@ -45,9 +45,9 @@ pub struct Compiler {
pub(crate) fn parse_cfg(dcx: &DiagCtxt, cfgs: Vec<String>) -> Cfg {
cfgs.into_iter()
.map(|s| {
let sess = ParseSess::with_silent_emitter(Some(format!(
let sess = ParseSess::with_silent_emitter(format!(
"this error occurred on the command line: `--cfg={s}`"
)));
));
let filename = FileName::cfg_spec_source_code(&s);
macro_rules! error {
@ -107,9 +107,9 @@ pub(crate) fn parse_check_cfg(dcx: &DiagCtxt, specs: Vec<String>) -> CheckCfg {
let mut check_cfg = CheckCfg { exhaustive_names, exhaustive_values, ..CheckCfg::default() };
for s in specs {
let sess = ParseSess::with_silent_emitter(Some(format!(
let sess = ParseSess::with_silent_emitter(format!(
"this error occurred on the command line: `--check-cfg={s}`"
)));
));
let filename = FileName::cfg_spec_source_code(&s);
macro_rules! error {