mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-06 03:52:53 +00:00
Don't mutably borrow GlobalCtxt in QueryResult::enter
This allows re-entrant entering of the GlobalCtxt
This commit is contained in:
parent
8fbe0466f5
commit
bec24a25cd
@ -62,7 +62,7 @@ impl<'a, T> std::ops::DerefMut for QueryResult<'a, T> {
|
|||||||
|
|
||||||
impl<'a, 'tcx> QueryResult<'a, &'tcx GlobalCtxt<'tcx>> {
|
impl<'a, 'tcx> QueryResult<'a, &'tcx GlobalCtxt<'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)
|
(*self.0).borrow().enter(f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user