From f7b3e39502783c82d4a8d9e02f59aa4268d15dbf Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 7 Feb 2023 16:11:40 +1100 Subject: Simplify `tls::enter_context`. --- compiler/rustc_interface/src/callbacks.rs | 2 +- compiler/rustc_interface/src/passes.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/callbacks.rs b/compiler/rustc_interface/src/callbacks.rs index ee0552d77ce..bc6d7c20997 100644 --- a/compiler/rustc_interface/src/callbacks.rs +++ b/compiler/rustc_interface/src/callbacks.rs @@ -38,7 +38,7 @@ fn track_diagnostic(diagnostic: &mut Diagnostic, f: &mut dyn FnMut(&mut Diagnost // Diagnostics are tracked, we can ignore the dependency. let icx = tls::ImplicitCtxt { task_deps: TaskDepsRef::Ignore, ..icx.clone() }; - return tls::enter_context(&icx, move |_| (*f)(diagnostic)); + return tls::enter_context(&icx, move || (*f)(diagnostic)); } // In any other case, invoke diagnostics anyway. diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 2a373ebc132..304c3257456 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -748,7 +748,7 @@ impl<'tcx> QueryContext<'tcx> { F: FnOnce(TyCtxt<'tcx>) -> R, { let icx = ty::tls::ImplicitCtxt::new(self.gcx); - ty::tls::enter_context(&icx, |_| f(icx.tcx)) + ty::tls::enter_context(&icx, || f(icx.tcx)) } } -- cgit 1.4.1-3-g733a5