From 77565f7950ae124452a168d0a839291d1d52a516 Mon Sep 17 00:00:00 2001
From: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date: Fri, 27 Jan 2023 11:46:20 +0000
Subject: [PATCH] Revert "Avoid a temporary file when processing macOS fat
archives"
This reverts commit bd8e476d8bd85b6d60a0de7694d154b4a74f5133.
---
.../rustc_codegen_ssa/src/back/archive.rs | 70 ++++++++++---------
1 file changed, 36 insertions(+), 34 deletions(-)
diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs
index 6eb120157da02..d3cd085cfb668 100644
--- a/compiler/rustc_codegen_ssa/src/back/archive.rs
+++ b/compiler/rustc_codegen_ssa/src/back/archive.rs
@@ -14,7 +14,7 @@ use tempfile::Builder as TempFileBuilder;
use std::error::Error;
use std::fs::File;
-use std::io;
+use std::io::{self, Write};
use std::path::{Path, PathBuf};
// Re-exporting for rustc_codegen_llvm::back::archive
@@ -116,11 +116,12 @@ impl<'a> ArArchiveBuilder<'a> {
}
}
-fn try_filter_fat_archs<'a>(
+fn try_filter_fat_archs(
archs: object::read::Result<&[impl FatArch]>,
target_arch: object::Architecture,
- archive_map_data: &'a [u8],
-) -> io::Result