From 98a6eaa7f8436cbedc79a21fe3ec62e8a35ef392 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 4 Nov 2023 15:49:57 +0000 Subject: 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. --- compiler/rustc_driver_impl/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_driver_impl/src') diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index a2a11ef5ac2..a0794daa23c 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -648,12 +648,11 @@ fn show_md_content_with_pager(content: &str, color: ColorConfig) { fn process_rlink(sess: &Session, compiler: &interface::Compiler) { assert!(sess.opts.unstable_opts.link_only); if let Input::File(file) = &sess.io.input { - let outputs = compiler.build_output_filenames(sess, &[]); let rlink_data = fs::read(file).unwrap_or_else(|err| { sess.emit_fatal(RlinkUnableToRead { err }); }); - let codegen_results = match CodegenResults::deserialize_rlink(sess, rlink_data) { - Ok(codegen) => codegen, + let (codegen_results, outputs) = match CodegenResults::deserialize_rlink(sess, rlink_data) { + Ok((codegen, outputs)) => (codegen, outputs), Err(err) => { match err { CodegenErrors::WrongFileType => sess.emit_fatal(RLinkWrongFileType), -- cgit 1.4.1-3-g733a5