diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-02-07 16:11:40 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-02-09 15:25:45 +1100 |
| commit | f7b3e39502783c82d4a8d9e02f59aa4268d15dbf (patch) | |
| tree | ec181e78c1795cb42e8d5cfcea8225894ce839f9 /compiler/rustc_middle | |
| parent | ef934d9b632b8ac00276558824664c104b92b5f0 (diff) | |
| download | rust-f7b3e39502783c82d4a8d9e02f59aa4268d15dbf.tar.gz rust-f7b3e39502783c82d4a8d9e02f59aa4268d15dbf.zip | |
Simplify `tls::enter_context`.
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/dep_graph/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context/tls.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/dep_graph/mod.rs b/compiler/rustc_middle/src/dep_graph/mod.rs index 2e62bebc852..2e82efba192 100644 --- a/compiler/rustc_middle/src/dep_graph/mod.rs +++ b/compiler/rustc_middle/src/dep_graph/mod.rs @@ -55,7 +55,7 @@ impl rustc_query_system::dep_graph::DepKind for DepKind { ty::tls::with_context(|icx| { let icx = ty::tls::ImplicitCtxt { task_deps, ..icx.clone() }; - ty::tls::enter_context(&icx, |_| op()) + ty::tls::enter_context(&icx, op) }) } diff --git a/compiler/rustc_middle/src/ty/context/tls.rs b/compiler/rustc_middle/src/ty/context/tls.rs index 71b025dc1be..4d1ddf0c7f1 100644 --- a/compiler/rustc_middle/src/ty/context/tls.rs +++ b/compiler/rustc_middle/src/ty/context/tls.rs @@ -110,9 +110,9 @@ unsafe fn downcast<'a, 'tcx>(context: *const ()) -> &'a ImplicitCtxt<'a, 'tcx> { #[inline] pub fn enter_context<'a, 'tcx, F, R>(context: &ImplicitCtxt<'a, 'tcx>, f: F) -> R where - F: FnOnce(&ImplicitCtxt<'a, 'tcx>) -> R, + F: FnOnce() -> R, { - tlv::with_tlv(erase(context), || f(&context)) + tlv::with_tlv(erase(context), f) } /// Allows access to the current `ImplicitCtxt` in a closure if one is available. |
