1
Fork 0

Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot

Introduce `DynSend` and `DynSync` auto trait for parallel compiler

part of parallel-rustc #101566

This PR introduces `DynSend / DynSync` trait and `FromDyn / IntoDyn` structure in rustc_data_structure::marker. `FromDyn` can dynamically check data structures for thread safety when switching to parallel environments (such as calling `par_for_each_in`). This happens only when `-Z threads > 1` so it doesn't affect single-threaded mode's compile efficiency.

r? `@cjgillot`
This commit is contained in:
bors 2023-05-13 13:47:53 +00:00
commit dd8ec9c88d
26 changed files with 557 additions and 110 deletions

View file

@ -739,6 +739,9 @@ fn main_args(at_args: &[String]) -> MainResult {
}
};
// Set parallel mode before error handler creation, which will create `Lock`s.
interface::set_thread_safe_mode(&options.unstable_opts);
let diag = core::new_handler(
options.error_format,
None,