Turn the "no saved object file in work product" ICE into a translatab… · rust-lang/rust@3d4a9f5 (original) (raw)

File tree

3 files changed

lines changed

3 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -190,6 +190,8 @@ codegen_ssa_no_module_named =
190 190
191 191 codegen_ssa_no_natvis_directory = error enumerating natvis directory: {$error}
192 192
193 +codegen_ssa_no_saved_object_file = cached cgu {$cgu_name} should have an object file, but doesn't
194 +
193 195 codegen_ssa_processing_dymutil_failed = processing debug info with `dsymutil` failed: {$status}
194 196 .note = {$output}
195 197
Original file line number Diff line number Diff line change
@@ -913,7 +913,9 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>(
913 913
914 914 let object = load_from_incr_comp_dir(
915 915 cgcx.output_filenames.temp_path(OutputType::Object, Some(&module.name)),
916 - module.source.saved_files.get("o").expect("no saved object file in work product"),
916 + module.source.saved_files.get("o").unwrap_or_else(|
917 + cgcx.create_dcx().emit_fatal(errors::NoSavedObjectFile { cgu_name: &module.name })
918 +}),
917 919 );
918 920 let dwarf_object =
919 921 module.source.saved_files.get("dwo").as_ref().and_then(|saved_dwarf_object_file
Original file line number Diff line number Diff line change
@@ -121,6 +121,12 @@ pub struct NoNatvisDirectory {
121 121 pub error: Error,
122 122 }
123 123
124 +#[derive(Diagnostic)]
125 +#[diag(codegen_ssa_no_saved_object_file)]
126 +pub struct NoSavedObjectFile<'a> {
127 +pub cgu_name: &'a str,
128 +}
129 +
124 130 #[derive(Diagnostic)]
125 131 #[diag(codegen_ssa_copy_path_buf)]
126 132 pub struct CopyPathBuf {