about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-02-22 18:47:59 +0400
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-03-13 17:31:55 +0400
commit4a61922ef00153a2c6e74d3cc97f687c9c8c6817 (patch)
tree2c802176721c3b34224afaf0c8b05b59c833e539 /compiler/rustc_resolve/src
parent98cce8191788de9103231b1892195e27500aa1f5 (diff)
downloadrust-4a61922ef00153a2c6e74d3cc97f687c9c8c6817.tar.gz
rust-4a61922ef00153a2c6e74d3cc97f687c9c8c6817.zip
metadata/resolve: Minor refactoring to "tcx -> cstore" conversions
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index ae1d9406467..cd90fd3ef84 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -1431,9 +1431,11 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
     }
 
     fn crate_loader<T>(&mut self, f: impl FnOnce(&mut CrateLoader<'_, '_>) -> T) -> T {
-        let mut cstore = self.tcx.untracked().cstore.write();
-        let cstore = cstore.untracked_as_any().downcast_mut().unwrap();
-        f(&mut CrateLoader::new(self.tcx, &mut *cstore, &mut self.used_extern_options))
+        f(&mut CrateLoader::new(
+            self.tcx,
+            &mut CStore::from_tcx_mut(self.tcx),
+            &mut self.used_extern_options,
+        ))
     }
 
     fn cstore(&self) -> MappedReadGuard<'_, CStore> {