Rollup merge of #154003 - ginnyTheCat:uefi-file-send, r=Mark-Simulacrum

Make std::fs::File Send on UEFI

Similarly to rust-lang/rust#150990 since UEFI has no threads, this should be safe.
This commit is contained in:
Jonathan Brouwer
2026-04-18 19:23:14 +02:00
committed by GitHub
+5
View File
@@ -588,6 +588,11 @@ pub(crate) struct File {
path: crate::path::PathBuf,
}
// SAFETY: UEFI has no regular threads, and as per <https://github.com/rust-lang/rust/issues/133604>
// 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<Self> {
let absolute = crate::path::absolute(path)?;