about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-03-20 18:26:09 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2022-03-20 20:36:08 +0100
commit056951d6289e3fbba444cbadec8b4eea7f92928e (patch)
treea346f55814756096537d9572dabbc264b02309ff /compiler/rustc_const_eval
parent4767ccec935824fa5d08ce3502b233d7a66adec1 (diff)
downloadrust-056951d6289e3fbba444cbadec8b4eea7f92928e.tar.gz
rust-056951d6289e3fbba444cbadec8b4eea7f92928e.zip
Take &mut Diagnostic in emit_diagnostic.
Taking a Diagnostic by move would break the usual pattern
`diag.label(..).emit()`.
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/check.rs4
1 files changed, 2 insertions, 2 deletions
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());