Serialize OutputFilenames into rmeta file

This ensures that linking will use the correct crate name even when
`#![crate_name = "..."]` is used to specify the crate name.
This commit is contained in:
bjorn3 2023-11-04 15:49:57 +00:00
parent eacbe65dfe
commit 98a6eaa7f8
5 changed files with 22 additions and 27 deletions

View file

@ -273,8 +273,13 @@ impl Linker {
if sess.opts.unstable_opts.no_link {
let rlink_file = self.output_filenames.with_extension(config::RLINK_EXT);
CodegenResults::serialize_rlink(sess, &rlink_file, &codegen_results)
.map_err(|error| sess.emit_fatal(FailedWritingFile { path: &rlink_file, error }))?;
CodegenResults::serialize_rlink(
sess,
&rlink_file,
&codegen_results,
&*self.output_filenames,
)
.map_err(|error| sess.emit_fatal(FailedWritingFile { path: &rlink_file, error }))?;
return Ok(());
}