diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-26 20:32:48 +0000 | 
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-11-09 17:55:39 +0000 | 
| commit | bec24a25cd61c5d252701b9119e4fe887b274937 (patch) | |
| tree | 2121eca5b6cca02fd5cd1053dac4ffd84c1a47e2 /compiler/rustc_interface/src/queries.rs | |
| parent | 8fbe0466f5c4b933b5c4adaae867899b90a23487 (diff) | |
| download | rust-bec24a25cd61c5d252701b9119e4fe887b274937.tar.gz rust-bec24a25cd61c5d252701b9119e4fe887b274937.zip | |
Don't mutably borrow GlobalCtxt in QueryResult::enter
This allows re-entrant entering of the GlobalCtxt
Diffstat (limited to 'compiler/rustc_interface/src/queries.rs')
| -rw-r--r-- | compiler/rustc_interface/src/queries.rs | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index b6837ec764f..ff8cf790ef8 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -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) } } | 
