This is just an issue noting down the things required to make rustc thread safe when queries can be used.
Make GlobalCtxt implement Sync
Use scoped thread locals instead of globals, WIP: Less globals #46193
Misc fixes required to use a rayon thread pool, WIP: Parallelize passes using rayon #46564
Ensure metadata loaded by LlvmMetadataLoader does not get freed on the wrong thread
CurrentDepGraph.task_stack has to be made a QueryJob field.
ParseSess.included_mod_stack might be problematic
Check that optimization fuel is not used with parallel queries
Ensure that the err_count() API is not used to discover if errors happen in parallel code
Find a way to order error messages deterministically so that if a query depends on another query, its error messages appear after the other query
Make mk_attr_id use a scoped thread local or make it part of ParseSess
See if we can get rid of locks on TransitiveRelation once old borrowck is gone
Review libproc_macro for issues, Find out which types should be Send, Sync. Deal with Deref impls for Symbol.
Run CI with cfg(parallel_queries)
Refactor away CStore::next_crate_num
Refactor away FileMap.external_src, FileMap.lines, FileMap.multibyte_chars, and FileMap.non_narrow_chars
When executing queries, instead of keeping around a lock to the query map, create a job object immediately instead
This is just an issue noting down the things required to make rustc thread safe when queries can be used.
QueryJobfield.mk_attr_iduse a scoped thread local or make it part ofParseSessTransitiveRelationonce old borrowck is gonelibproc_macrofor issues, Find out which types should beSend,Sync. Deal withDerefimpls forSymbol.CStore::next_crate_numFileMap.external_src,FileMap.lines,FileMap.multibyte_chars, andFileMap.non_narrow_chars