Skip to content

Commit bec24a2

Browse files
committed
Don't mutably borrow GlobalCtxt in QueryResult::enter
This allows re-entrant entering of the GlobalCtxt
1 parent 8fbe046 commit bec24a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_interface/src/queries.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'a, T> std::ops::DerefMut for QueryResult<'a, T> {
6262

6363
impl<'a, 'tcx> QueryResult<'a, &'tcx GlobalCtxt<'tcx>> {
6464
pub fn enter<T>(&mut self, f: impl FnOnce(TyCtxt<'tcx>) -> T) -> T {
65-
(*self.0).get_mut().enter(f)
65+
(*self.0).borrow().enter(f)
6666
}
6767
}
6868

0 commit comments

Comments
 (0)