diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-30 18:19:40 +1100 | 
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-30 20:45:11 +1100 | 
| commit | 90862f63f9bc9f68cf28af6be31b4600c996bdf3 (patch) | |
| tree | 896abfb6c37376db086a32986ff5d6617415ae97 | |
| parent | be8fd8b7d028c50c66b6300aa1bf692afe2e231c (diff) | |
| download | rust-90862f63f9bc9f68cf28af6be31b4600c996bdf3.tar.gz rust-90862f63f9bc9f68cf28af6be31b4600c996bdf3.zip  | |
Remove an unnecessary `drop`.
| -rw-r--r-- | compiler/rustc_interface/src/callbacks.rs | 4 | 
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.  | 
