diff options
| author | bors <bors@rust-lang.org> | 2024-01-11 20:01:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-11 20:01:01 +0000 |
| commit | 62d7ed4a6775c4490e493093ca98ef7c215b835b (patch) | |
| tree | cd2c1a220226731839eb3485268861de65a162c8 /compiler/rustc_interface/src/interface.rs | |
| parent | 4d31ed4cdbcf4a0441f5b0d4e8f6cc3bb875b5b4 (diff) | |
| parent | b3d15ebb08ddeecbdcb92e5f2121975a54b901ad (diff) | |
| download | rust-62d7ed4a6775c4490e493093ca98ef7c215b835b.tar.gz rust-62d7ed4a6775c4490e493093ca98ef7c215b835b.zip | |
Auto merge of #119864 - matthiaskrgr:rollup-mc2qz13, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #119448 (annotate-snippets: update to 0.10) - #119813 (Silence some follow-up errors [2/x]) - #119836 (chore: remove unnecessary blank line) - #119841 (Remove `DiagnosticBuilder::buffer`) - #119842 (coverage: Add enums to accommodate other kinds of coverage mappings) - #119845 (rint: further doc tweaks) - #119852 (give const-err4 a more descriptive name) - #119853 (rustfmt.toml: don't ignore just any tests path, only root one) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 6c000380e71..03335996c03 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -82,7 +82,7 @@ pub(crate) fn parse_cfg(dcx: &DiagCtxt, cfgs: Vec<String>) -> Cfg { Ok(..) => {} Err(err) => err.cancel(), }, - Err(errs) => drop(errs), + Err(errs) => errs.into_iter().for_each(|err| err.cancel()), } // If the user tried to use a key="value" flag, but is missing the quotes, provide @@ -129,9 +129,12 @@ pub(crate) fn parse_check_cfg(dcx: &DiagCtxt, specs: Vec<String>) -> CheckCfg { error!("expected `cfg(name, values(\"value1\", \"value2\", ... \"valueN\"))`") }; - let Ok(mut parser) = maybe_new_parser_from_source_str(&sess, filename, s.to_string()) - else { - expected_error(); + let mut parser = match maybe_new_parser_from_source_str(&sess, filename, s.to_string()) { + Ok(parser) => parser, + Err(errs) => { + errs.into_iter().for_each(|err| err.cancel()); + expected_error(); + } }; let meta_item = match parser.parse_meta_item() { |
