about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/interface.rs
diff options
context:
space:
mode:
authorSparrowLii <liyuan179@huawei.com>2023-03-03 10:14:57 +0800
committerSparrowLii <liyuan179@huawei.com>2023-05-06 09:34:18 +0800
commitb9746ce03901fc39707c8c2d0405caf5384b4e97 (patch)
tree64ccb0f53279ed73da3b25f09d55029c9ae81323 /compiler/rustc_interface/src/interface.rs
parent963e5c0eff171160238dc2a2c0ba7a1912fada67 (diff)
downloadrust-b9746ce03901fc39707c8c2d0405caf5384b4e97.tar.gz
rust-b9746ce03901fc39707c8c2d0405caf5384b4e97.zip
introduce `DynSend` and `DynSync` auto trait
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
-rw-r--r--compiler/rustc_interface/src/interface.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs
index 9d9f4ee13f4..2a091077700 100644
--- a/compiler/rustc_interface/src/interface.rs
+++ b/compiler/rustc_interface/src/interface.rs
@@ -60,6 +60,11 @@ impl Compiler {
     }
 }
 
+#[allow(rustc::bad_opt_access)]
+pub fn set_parallel_mode(sopts: &config::UnstableOptions) {
+    rustc_data_structures::sync::set(sopts.threads > 1);
+}
+
 /// Converts strings provided as `--cfg [cfgspec]` into a `crate_cfg`.
 pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String>)> {
     rustc_span::create_default_session_if_not_set_then(move |_| {