From b4ba2f0bf469da7a5fea38f2ef2a9bd069736eba Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 1 May 2023 17:09:59 +1000 Subject: Change rlink serialization from `MemEncoder` to `FileEncoder`. Because we're writing to a file, so `FileEncoder` is better because we don't have to write all the data to memory first. --- compiler/rustc_interface/src/queries.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 77fbbf64a0a..6483d51a0b9 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -368,9 +368,8 @@ impl Linker { } if sess.opts.unstable_opts.no_link { - let encoded = CodegenResults::serialize_rlink(&codegen_results); let rlink_file = self.prepare_outputs.with_extension(config::RLINK_EXT); - std::fs::write(&rlink_file, encoded) + CodegenResults::serialize_rlink(&rlink_file, &codegen_results) .map_err(|error| sess.emit_fatal(FailedWritingFile { path: &rlink_file, error }))?; return Ok(()); } -- cgit 1.4.1-3-g733a5