Remove unused record parsing and misleading file helpers

This commit is contained in:
Rui Ueyama committed 2026-09-14 22:54:34 +09:00
1 parent d6bf14c5b3
commit aed83a2109
3 files changed
+1 -10

No files matched your search

+1 -1
View File
@@ -1872,7 +1872,7 @@ pub fn parse_args(target: &TargetTraits, raw_cmdline: &[Cow<'_, OsStr>]) -> Pars
} else if read_arg!("rpath", true) {
add_rpath(&mut a, &mut rpaths, raw_arg);
} else if read_arg!("R", true) {
if crate::mapped_file::is_file(raw_arg) {
if Path::new(raw_arg).metadata().is_ok_and(|m| !m.is_dir()) {
fatal!(
"-R{}: -R as an alias for --just-symbols is not supported",
raw_arg.to_string_lossy()
-4
View File
@@ -60,10 +60,6 @@ pub unsafe trait FileRecord: Clone + Copy + Default + Send + Sync + 'static {
unsafe { bytes.as_ptr().cast::<Self>().read_unaligned() }
}
fn parse_all(bytes: &[u8]) -> Vec<Self> {
bytes.chunks_exact(Self::size()).map(Self::parse).collect()
}
fn write(&self, buf: &mut [u8]) {
assert!(buf.len() >= Self::size());
// SAFETY: `buf` has room for the complete record, and copying bytes
-5
View File
@@ -273,8 +273,3 @@ pub fn must_open_file(chroot: &Path, path: impl AsRef<Path>) -> &'static MappedF
MappedFile::open_impl(&apply_chroot(chroot, path))
.unwrap_or_else(|e| fatal!("cannot open {}: {e}", path.display()))
}
/// Whether a path refers to something that is not a directory.
pub fn is_file(path: impl AsRef<Path>) -> bool {
path.as_ref().metadata().is_ok_and(|m| !m.is_dir())
}