From a227bc7ee912d20146aaebc2de5d9bb8aa29665e Mon Sep 17 00:00:00 2001 From: ginnyTheCat Date: Thu, 26 Mar 2026 17:42:08 +0100 Subject: [PATCH] Make std::fs::File Send on UEFI --- library/std/src/sys/fs/uefi.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/std/src/sys/fs/uefi.rs b/library/std/src/sys/fs/uefi.rs index 8135519317a0..ef523a9807f1 100644 --- a/library/std/src/sys/fs/uefi.rs +++ b/library/std/src/sys/fs/uefi.rs @@ -588,6 +588,11 @@ pub(crate) struct File { path: crate::path::PathBuf, } + // SAFETY: UEFI has no regular threads, and as per + // std does not support being invoked from "irregular threads" such as interrupt handlers or other + // CPU cores that run outside the scope of UEFI. + unsafe impl Send for File {} + impl File { pub(crate) fn from_path(path: &Path, open_mode: u64, attr: u64) -> io::Result { let absolute = crate::path::absolute(path)?;