diff options
| author | bors <bors@rust-lang.org> | 2022-06-07 11:08:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-07 11:08:58 +0000 |
| commit | 7fe2c4b00dfbc33643e1af4b293eb057306a8339 (patch) | |
| tree | 89cb7f71b608fa16f00b3efd70c4afbefd51280a /compiler/rustc_codegen_ssa | |
| parent | 91cacb3faf987805675e39aca41859ec1fcabef3 (diff) | |
| parent | 95266530d5b97a51b4ad110733fa276f85c27b43 (diff) | |
| download | rust-7fe2c4b00dfbc33643e1af4b293eb057306a8339.tar.gz rust-7fe2c4b00dfbc33643e1af4b293eb057306a8339.zip | |
Auto merge of #97825 - Dylan-DPC:rollup-ya51k1k, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #97058 (Various refactors to the incr comp workproduct handling) - #97301 (Allow unstable items to be re-exported unstably without requiring the feature be enabled) - #97738 (Fix ICEs from zsts within unsized types with non-zero offsets) - #97771 (Remove SIGIO reference on Haiku) - #97808 (Add some unstable target features for the wasm target codegen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/write.rs | 54 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/base.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/target_features.rs | 3 |
3 files changed, 33 insertions, 33 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 88293dec01c..02c7c1a435f 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -494,12 +494,12 @@ fn copy_all_cgu_workproducts_to_incr_comp_cache_dir( let _timer = sess.timer("copy_all_cgu_workproducts_to_incr_comp_cache_dir"); for module in compiled_modules.modules.iter().filter(|m| m.kind == ModuleKind::Regular) { - let path = module.object.as_ref().cloned(); - - if let Some((id, product)) = - copy_cgu_workproduct_to_incr_comp_cache_dir(sess, &module.name, &path) - { - work_products.insert(id, product); + if let Some(path) = &module.object { + if let Some((id, product)) = + copy_cgu_workproduct_to_incr_comp_cache_dir(sess, &module.name, path) + { + work_products.insert(id, product); + } } } @@ -853,35 +853,31 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>( module: CachedModuleCodegen, module_config: &ModuleConfig, ) -> WorkItemResult<B> { + assert!(module_config.emit_obj != EmitObj::None); + let incr_comp_session_dir = cgcx.incr_comp_session_dir.as_ref().unwrap(); - let mut object = None; - if let Some(saved_file) = module.source.saved_file { - let obj_out = cgcx.output_filenames.temp_path(OutputType::Object, Some(&module.name)); - object = Some(obj_out.clone()); - let source_file = in_incr_comp_dir(&incr_comp_session_dir, &saved_file); - debug!( - "copying pre-existing module `{}` from {:?} to {}", - module.name, - source_file, - obj_out.display() - ); - if let Err(err) = link_or_copy(&source_file, &obj_out) { - let diag_handler = cgcx.create_diag_handler(); - diag_handler.err(&format!( - "unable to copy {} to {}: {}", - source_file.display(), - obj_out.display(), - err - )); - } + let obj_out = cgcx.output_filenames.temp_path(OutputType::Object, Some(&module.name)); + let source_file = in_incr_comp_dir(&incr_comp_session_dir, &module.source.saved_file); + debug!( + "copying pre-existing module `{}` from {:?} to {}", + module.name, + source_file, + obj_out.display() + ); + if let Err(err) = link_or_copy(&source_file, &obj_out) { + let diag_handler = cgcx.create_diag_handler(); + diag_handler.err(&format!( + "unable to copy {} to {}: {}", + source_file.display(), + obj_out.display(), + err + )); } - assert_eq!(object.is_some(), module_config.emit_obj != EmitObj::None); - WorkItemResult::Compiled(CompiledModule { name: module.name, kind: ModuleKind::Regular, - object, + object: Some(obj_out), dwarf_object: None, bytecode: None, }) diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index 420adec456f..7e2e85ead54 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -216,11 +216,12 @@ pub fn unsize_ptr<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( let mut result = None; for i in 0..src_layout.fields.count() { let src_f = src_layout.field(bx.cx(), i); - assert_eq!(src_layout.fields.offset(i).bytes(), 0); - assert_eq!(dst_layout.fields.offset(i).bytes(), 0); if src_f.is_zst() { continue; } + + assert_eq!(src_layout.fields.offset(i).bytes(), 0); + assert_eq!(dst_layout.fields.offset(i).bytes(), 0); assert_eq!(src_layout.size, src_f.size); let dst_f = dst_layout.field(bx.cx(), i); @@ -716,7 +717,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>( &ongoing_codegen.coordinator_send, CachedModuleCodegen { name: cgu.name().to_string(), - source: cgu.work_product(tcx), + source: cgu.previous_work_product(tcx), }, ); true @@ -727,7 +728,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>( &ongoing_codegen.coordinator_send, CachedModuleCodegen { name: cgu.name().to_string(), - source: cgu.work_product(tcx), + source: cgu.previous_work_product(tcx), }, ); true diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index ba1e1862227..bfdef2dc0e8 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -246,6 +246,9 @@ const WASM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[ ("simd128", None), ("atomics", Some(sym::wasm_target_feature)), ("nontrapping-fptoint", Some(sym::wasm_target_feature)), + ("bulk-memory", Some(sym::wasm_target_feature)), + ("mutable-globals", Some(sym::wasm_target_feature)), + ("reference-types", Some(sym::wasm_target_feature)), ]; const BPF_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[("alu32", Some(sym::bpf_target_feature))]; |
