Don't mutably borrow GlobalCtxt in QueryResult::enter

This allows re-entrant entering of the GlobalCtxt
This commit is contained in:
bjorn3 2023-11-26 20:32:48 +00:00
parent 8fbe0466f5
commit bec24a25cd

View File

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