Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 28db796

Browse files
committedApr 2, 2025·
Address comments
1 parent 229e548 commit 28db796

File tree

2 files changed

+12
-15
lines changed
  • compiler

2 files changed

+12
-15
lines changed
 

‎compiler/rustc_codegen_cranelift/src/driver/aot.rs

+8-15
Original file line numberDiff line numberDiff line change
@@ -732,21 +732,14 @@ pub(crate) fn run_aot(
732732
tcx.sess.time("codegen mono items", || {
733733
let modules: Vec<_> = par_map(todo_cgus, |(_, cgu)| {
734734
let dep_node = cgu.codegen_dep_node(tcx);
735-
IntoDynSyncSend(
736-
tcx.dep_graph
737-
.with_task(
738-
dep_node,
739-
tcx,
740-
(
741-
global_asm_config.clone(),
742-
cgu.name(),
743-
concurrency_limiter.acquire(tcx.dcx()),
744-
),
745-
module_codegen,
746-
Some(rustc_middle::dep_graph::hash_result),
747-
)
748-
.0,
749-
)
735+
let (module, _) = tcx.dep_graph.with_task(
736+
dep_node,
737+
tcx,
738+
(global_asm_config.clone(), cgu.name(), concurrency_limiter.acquire(tcx.dcx())),
739+
module_codegen,
740+
Some(rustc_middle::dep_graph::hash_result),
741+
);
742+
IntoDynSyncSend(module)
750743
});
751744
modules
752745
.into_iter()

‎compiler/rustc_data_structures/src/sync/parallel.rs

+4
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ pub fn par_for_each_in<I: DynSend, T: IntoIterator<Item = I>>(
175175
});
176176
}
177177

178+
/// This runs `for_each` in parallel for each iterator item. If one or more of the
179+
/// `for_each` calls returns `Err`, the function will also return `Err`. The error returned
180+
/// will be non-deterministic, but this is expected to be used with `ErrorGuaranteed` which
181+
/// are all equivalent.
178182
pub fn try_par_for_each_in<T: IntoIterator, E: DynSend>(
179183
t: T,
180184
for_each: impl Fn(&<T as IntoIterator>::Item) -> Result<(), E> + DynSync + DynSend,

0 commit comments

Comments
 (0)
Please sign in to comment.