about summary refs log tree commit diff
path: root/compiler/rustc_parse
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_parse
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_parse')
-rw-r--r--compiler/rustc_parse/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs
index a3e66464fbc..0ce86a764f4 100644
--- a/compiler/rustc_parse/src/lib.rs
+++ b/compiler/rustc_parse/src/lib.rs
@@ -49,8 +49,8 @@ macro_rules! panictry_buffer {
         match $e {
             Ok(e) => e,
             Err(errs) => {
-                for e in errs {
-                    $handler.emit_diagnostic(&e);
+                for mut e in errs {
+                    $handler.emit_diagnostic(&mut e);
                 }
                 FatalError.raise()
             }
@@ -167,8 +167,8 @@ fn try_file_to_source_file(
 fn file_to_source_file(sess: &ParseSess, path: &Path, spanopt: Option<Span>) -> Lrc<SourceFile> {
     match try_file_to_source_file(sess, path, spanopt) {
         Ok(source_file) => source_file,
-        Err(d) => {
-            sess.span_diagnostic.emit_diagnostic(&d);
+        Err(mut d) => {
+            sess.span_diagnostic.emit_diagnostic(&mut d);
             FatalError.raise();
         }
     }