diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-05-01 17:09:59 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-05-01 17:09:59 +1000 |
| commit | b4ba2f0bf469da7a5fea38f2ef2a9bd069736eba (patch) | |
| tree | a6236d9a6a006a7c6934bf73288dd0267667ae8b /compiler/rustc_interface | |
| parent | 9ecda8de85ce893cc3fc748ab06be0b8250147a7 (diff) | |
| download | rust-b4ba2f0bf469da7a5fea38f2ef2a9bd069736eba.tar.gz rust-b4ba2f0bf469da7a5fea38f2ef2a9bd069736eba.zip | |
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.
Diffstat (limited to 'compiler/rustc_interface')
| -rw-r--r-- | compiler/rustc_interface/src/queries.rs | 3 |
1 files changed, 1 insertions, 2 deletions
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(()); } |
