diff options
| author | bors <bors@rust-lang.org> | 2025-04-11 04:24:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-11 04:24:47 +0000 |
| commit | 18a029cfe8e761533634bda8fe8a14e30280a21b (patch) | |
| tree | 22fdd3557c3ee667ad99c746c518868bd861e0f7 /compiler/rustc_interface/src/util.rs | |
| parent | e62d47daceeec445edede74c87d0d0a3acb1a175 (diff) | |
| parent | 96d282c87b576407b5816bce090a8679f49d7fe3 (diff) | |
| download | rust-18a029cfe8e761533634bda8fe8a14e30280a21b.tar.gz rust-18a029cfe8e761533634bda8fe8a14e30280a21b.zip | |
Auto merge of #139657 - Zalathar:rollup-6oh6f9q, r=Zalathar
Rollup of 12 pull requests
Successful merges:
- #137447 (add `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`)
- #138182 (rustc_target: update x86_win64 to match the documented calling convention for f128)
- #138682 (Allow drivers to supply a list of extra symbols to intern)
- #138904 (Test linking and running `no_std` binaries)
- #138998 (Don't suggest the use of `impl Trait` in closure parameter)
- #139447 (doc changes: debug assertions -> overflow checks)
- #139469 (Introduce a `//@ needs-crate-type` compiletest directive)
- #139564 (Deeply normalize obligations in `BestObligation` folder)
- #139574 (bootstrap: improve `channel` handling)
- #139600 (Update `compiler-builtins` to 0.1.153)
- #139641 (Allow parenthesis around inferred array lengths)
- #139654 (Improve `AssocItem::descr`.)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_interface/src/util.rs')
| -rw-r--r-- | compiler/rustc_interface/src/util.rs | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index 83d80938b4e..f5d4f3fc118 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -117,6 +117,7 @@ fn run_in_thread_with_globals<F: FnOnce(CurrentGcx) -> R + Send, R: Send>( thread_stack_size: usize, edition: Edition, sm_inputs: SourceMapInputs, + extra_symbols: &[&'static str], f: F, ) -> R { // The "thread pool" is a single spawned thread in the non-parallel @@ -134,9 +135,12 @@ fn run_in_thread_with_globals<F: FnOnce(CurrentGcx) -> R + Send, R: Send>( // name contains null bytes. let r = builder .spawn_scoped(s, move || { - rustc_span::create_session_globals_then(edition, Some(sm_inputs), || { - f(CurrentGcx::new()) - }) + rustc_span::create_session_globals_then( + edition, + extra_symbols, + Some(sm_inputs), + || f(CurrentGcx::new()), + ) }) .unwrap() .join(); @@ -152,6 +156,7 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send, thread_builder_diag: &EarlyDiagCtxt, edition: Edition, threads: usize, + extra_symbols: &[&'static str], sm_inputs: SourceMapInputs, f: F, ) -> R { @@ -168,12 +173,18 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send, let registry = sync::Registry::new(std::num::NonZero::new(threads).unwrap()); if !sync::is_dyn_thread_safe() { - return run_in_thread_with_globals(thread_stack_size, edition, sm_inputs, |current_gcx| { - // Register the thread for use with the `WorkerLocal` type. - registry.register(); - - f(current_gcx) - }); + return run_in_thread_with_globals( + thread_stack_size, + edition, + sm_inputs, + extra_symbols, + |current_gcx| { + // Register the thread for use with the `WorkerLocal` type. + registry.register(); + + f(current_gcx) + }, + ); } let current_gcx = FromDyn::from(CurrentGcx::new()); @@ -230,7 +241,7 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send, // pool. Upon creation, each worker thread created gets a copy of the // session globals in TLS. This is possible because `SessionGlobals` impls // `Send` in the parallel compiler. - rustc_span::create_session_globals_then(edition, Some(sm_inputs), || { + rustc_span::create_session_globals_then(edition, extra_symbols, Some(sm_inputs), || { rustc_span::with_session_globals(|session_globals| { let session_globals = FromDyn::from(session_globals); builder |
