Store the gctxt instead of fetching it twice.
This commit is contained in:
parent
3ddb54f155
commit
261bbd7dba
3 changed files with 9 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue