Store the gctxt instead of fetching it twice.

This commit is contained in:
Oli Scherer 2023-01-19 14:12:29 +00:00
parent 3ddb54f155
commit 261bbd7dba
3 changed files with 9 additions and 5 deletions

View file

@ -65,7 +65,7 @@ impl<'a, T> std::ops::DerefMut for QueryResult<'a, T> {
}
impl<'a, 'tcx> QueryResult<'a, QueryContext<'tcx>> {
pub fn enter<T>(mut self, f: impl FnOnce(TyCtxt<'tcx>) -> T) -> T {
pub fn enter<T>(&mut self, f: impl FnOnce(TyCtxt<'tcx>) -> T) -> T {
(*self.0).get_mut().enter(f)
}
}