rustc_metadata: Freeze cstore after the full crate list is queried
This commit is contained in:
parent
71927ad083
commit
1cec923fbb
1 changed files with 3 additions and 0 deletions
|
@ -490,6 +490,9 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
|
|||
.alloc_slice(&CStore::from_tcx(tcx).crate_dependencies_in_postorder(LOCAL_CRATE))
|
||||
},
|
||||
crates: |tcx, ()| {
|
||||
// The list of loaded crates is now frozen in query cache,
|
||||
// so make sure cstore is not mutably accessed from here on.
|
||||
tcx.untracked().cstore.leak();
|
||||
tcx.arena.alloc_from_iter(CStore::from_tcx(tcx).iter_crate_data().map(|(cnum, _)| cnum))
|
||||
},
|
||||
..*providers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue