about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-10-30 18:19:40 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-10-30 20:45:11 +1100
commit90862f63f9bc9f68cf28af6be31b4600c996bdf3 (patch)
tree896abfb6c37376db086a32986ff5d6617415ae97
parentbe8fd8b7d028c50c66b6300aa1bf692afe2e231c (diff)
downloadrust-90862f63f9bc9f68cf28af6be31b4600c996bdf3.tar.gz
rust-90862f63f9bc9f68cf28af6be31b4600c996bdf3.zip
Remove an unnecessary `drop`.
-rw-r--r--compiler/rustc_interface/src/callbacks.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_interface/src/callbacks.rs b/compiler/rustc_interface/src/callbacks.rs
index 6fa989bb96c..ef00ced67ff 100644
--- a/compiler/rustc_interface/src/callbacks.rs
+++ b/compiler/rustc_interface/src/callbacks.rs
@@ -33,9 +33,7 @@ fn track_diagnostic(diagnostic: &mut Diagnostic, f: &mut dyn FnMut(&mut Diagnost
     tls::with_context_opt(|icx| {
         if let Some(icx) = icx {
             if let Some(diagnostics) = icx.diagnostics {
-                let mut diagnostics = diagnostics.lock();
-                diagnostics.extend(Some(diagnostic.clone()));
-                std::mem::drop(diagnostics);
+                diagnostics.lock().extend(Some(diagnostic.clone()));
             }
 
             // Diagnostics are tracked, we can ignore the dependency.