Remove an unnecessary drop.

This commit is contained in:
Nicholas Nethercote 2023-10-30 18:19:40 +11:00
parent be8fd8b7d0
commit 90862f63f9

View File

@ -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.