Skip to content

Commit b867d41

Browse files
committed
Auto merge of rust-lang#97825 - Dylan-DPC:rollup-ya51k1k, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#97058 (Various refactors to the incr comp workproduct handling) - rust-lang#97301 (Allow unstable items to be re-exported unstably without requiring the feature be enabled) - rust-lang#97738 (Fix ICEs from zsts within unsized types with non-zero offsets) - rust-lang#97771 (Remove SIGIO reference on Haiku) - rust-lang#97808 (Add some unstable target features for the wasm target codegen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents d8bd0a9 + 3d8e854 commit b867d41

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

src/driver/aot.rs

+12-21
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ fn emit_module(
6666
let work_product = if backend_config.disable_incr_cache {
6767
None
6868
} else {
69-
rustc_incremental::copy_cgu_workproduct_to_incr_comp_cache_dir(
70-
tcx.sess,
71-
&name,
72-
&Some(tmp_file.clone()),
73-
)
69+
rustc_incremental::copy_cgu_workproduct_to_incr_comp_cache_dir(tcx.sess, &name, &tmp_file)
7470
};
7571

7672
ModuleCodegenResult(
@@ -84,29 +80,24 @@ fn reuse_workproduct_for_cgu(
8480
cgu: &CodegenUnit<'_>,
8581
work_products: &mut FxHashMap<WorkProductId, WorkProduct>,
8682
) -> CompiledModule {
87-
let mut object = None;
88-
let work_product = cgu.work_product(tcx);
89-
if let Some(saved_file) = &work_product.saved_file {
90-
let obj_out =
91-
tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu.name().as_str()));
92-
object = Some(obj_out.clone());
93-
let source_file = rustc_incremental::in_incr_comp_dir_sess(&tcx.sess, &saved_file);
94-
if let Err(err) = rustc_fs_util::link_or_copy(&source_file, &obj_out) {
95-
tcx.sess.err(&format!(
96-
"unable to copy {} to {}: {}",
97-
source_file.display(),
98-
obj_out.display(),
99-
err
100-
));
101-
}
83+
let work_product = cgu.previous_work_product(tcx);
84+
let obj_out = tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu.name().as_str()));
85+
let source_file = rustc_incremental::in_incr_comp_dir_sess(&tcx.sess, &work_product.saved_file);
86+
if let Err(err) = rustc_fs_util::link_or_copy(&source_file, &obj_out) {
87+
tcx.sess.err(&format!(
88+
"unable to copy {} to {}: {}",
89+
source_file.display(),
90+
obj_out.display(),
91+
err
92+
));
10293
}
10394

10495
work_products.insert(cgu.work_product_id(), work_product);
10596

10697
CompiledModule {
10798
name: cgu.name().to_string(),
10899
kind: ModuleKind::Regular,
109-
object,
100+
object: Some(obj_out),
110101
dwarf_object: None,
111102
bytecode: None,
112103
}

0 commit comments

Comments
 (0)