From 0b9d70cf6d47df456280f83b58c04c96aa58e89e Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 26 Jan 2022 03:39:14 +0000 Subject: rustc_errors: take `self` by value in `DiagnosticBuilder::cancel`. --- compiler/rustc_interface/src/interface.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 609fc4b78c0..e518edcff02 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -102,7 +102,7 @@ pub fn parse_cfgspecs(cfgspecs: Vec) -> FxHashSet<(String, Option match &mut parser.parse_meta_item() { + Ok(mut parser) => match parser.parse_meta_item() { Ok(meta_item) if parser.token == token::Eof => { if meta_item.path.segments.len() != 1 { error!("argument key must be an identifier"); @@ -121,7 +121,7 @@ pub fn parse_cfgspecs(cfgspecs: Vec) -> FxHashSet<(String, Option {} Err(err) => err.cancel(), }, - Err(errs) => errs.into_iter().for_each(|mut err| err.cancel()), + Err(errs) => drop(errs), } // If the user tried to use a key="value" flag, but is missing the quotes, provide @@ -165,7 +165,7 @@ pub fn parse_check_cfg(specs: Vec) -> CheckCfg { } match maybe_new_parser_from_source_str(&sess, filename, s.to_string()) { - Ok(mut parser) => match &mut parser.parse_meta_item() { + Ok(mut parser) => match parser.parse_meta_item() { Ok(meta_item) if parser.token == token::Eof => { if let Some(args) = meta_item.meta_item_list() { if meta_item.has_name(sym::names) { @@ -210,7 +210,7 @@ pub fn parse_check_cfg(specs: Vec) -> CheckCfg { Ok(..) => {} Err(err) => err.cancel(), }, - Err(errs) => errs.into_iter().for_each(|mut err| err.cancel()), + Err(errs) => drop(errs), } error!( -- cgit 1.4.1-3-g733a5