From 056951d6289e3fbba444cbadec8b4eea7f92928e Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 20 Mar 2022 18:26:09 +0100 Subject: Take &mut Diagnostic in emit_diagnostic. Taking a Diagnostic by move would break the usual pattern `diag.label(..).emit()`. --- compiler/rustc_const_eval/src/transform/check_consts/check.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_const_eval') diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index eb01e261c1a..223b3ad0cf9 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -255,8 +255,8 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> { // "secondary" errors if they occurred. let secondary_errors = mem::take(&mut self.secondary_errors); if self.error_emitted.is_none() { - for error in secondary_errors { - self.tcx.sess.diagnostic().emit_diagnostic(&error); + for mut error in secondary_errors { + self.tcx.sess.diagnostic().emit_diagnostic(&mut error); } } else { assert!(self.tcx.sess.has_errors().is_some()); -- cgit 1.4.1-3-g733a5