From 261bbd7dbaaeb3a4f3d25610b6f93aac874bd910 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 19 Jan 2023 14:12:29 +0000 Subject: Store the gctxt instead of fetching it twice. --- compiler/rustc_interface/src/queries.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 96cd3b06321..4b0180741c1 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -65,7 +65,7 @@ impl<'a, T> std::ops::DerefMut for QueryResult<'a, T> { } impl<'a, 'tcx> QueryResult<'a, QueryContext<'tcx>> { - pub fn enter(mut self, f: impl FnOnce(TyCtxt<'tcx>) -> T) -> T { + pub fn enter(&mut self, f: impl FnOnce(TyCtxt<'tcx>) -> T) -> T { (*self.0).get_mut().enter(f) } } -- cgit 1.4.1-3-g733a5