diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-02-21 08:37:10 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-02-21 08:38:24 +0000 |
| commit | decfb4d123651a0673db47542e18ca60d1c501ac (patch) | |
| tree | cdfb83b31154c07755eaf21b97fa51ddfe01e64f /compiler/rustc_middle/src/ty/context.rs | |
| parent | a04e78730e501de7147ba8c09372348529b00c17 (diff) | |
| download | rust-decfb4d123651a0673db47542e18ca60d1c501ac.tar.gz rust-decfb4d123651a0673db47542e18ca60d1c501ac.zip | |
Use a lock-free datastructure for `source_span`
Diffstat (limited to 'compiler/rustc_middle/src/ty/context.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index cf4836ded47..d95e4b56de0 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1030,7 +1030,7 @@ impl<'tcx> TyCtxt<'tcx> { /// system if the result is otherwise tracked through queries #[inline] pub fn source_span_untracked(self, def_id: LocalDefId) -> Span { - self.untracked.source_span.read().get(def_id).copied().unwrap_or(DUMMY_SP) + self.untracked.source_span.get(def_id).unwrap_or(DUMMY_SP) } #[inline(always)] @@ -2521,6 +2521,5 @@ pub fn provide(providers: &mut ty::query::Providers) { // We want to check if the panic handler was defined in this crate tcx.lang_items().panic_impl().map_or(false, |did| did.is_local()) }; - providers.source_span = - |tcx, def_id| tcx.untracked.source_span.read().get(def_id).copied().unwrap_or(DUMMY_SP); + providers.source_span = |tcx, def_id| tcx.untracked.source_span.get(def_id).unwrap_or(DUMMY_SP); } |
