From 5a8835feba14d6a14fb02a381bf5c6c294237efc Mon Sep 17 00:00:00 2001 From: Mathieu Strypsteen Date: Fri, 10 Jan 2025 20:43:17 +0100 Subject: [PATCH] Fix for 1.84 --- library/std/src/sys/pal/osstd/fs.rs | 20 ++++++++++++++++++++ library/std/src/sys/pal/osstd/io.rs | 7 ++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/library/std/src/sys/pal/osstd/fs.rs b/library/std/src/sys/pal/osstd/fs.rs index 474c9fe97d1..9585ec24f68 100644 --- a/library/std/src/sys/pal/osstd/fs.rs +++ b/library/std/src/sys/pal/osstd/fs.rs @@ -198,6 +198,26 @@ impl File { self.0 } + pub fn lock(&self) -> io::Result<()> { + self.0 + } + + pub fn lock_shared(&self) -> io::Result<()> { + self.0 + } + + pub fn try_lock(&self) -> io::Result { + self.0 + } + + pub fn try_lock_shared(&self) -> io::Result { + self.0 + } + + pub fn unlock(&self) -> io::Result<()> { + self.0 + } + pub fn truncate(&self, _size: u64) -> io::Result<()> { self.0 } diff --git a/library/std/src/sys/pal/osstd/io.rs b/library/std/src/sys/pal/osstd/io.rs index 6372fca74e0..604735d32d5 100644 --- a/library/std/src/sys/pal/osstd/io.rs +++ b/library/std/src/sys/pal/osstd/io.rs @@ -15,7 +15,7 @@ impl<'a> IoSlice<'a> { } #[inline] - pub fn as_slice(&self) -> &[u8] { + pub const fn as_slice(&self) -> &'a [u8] { self.0 } } @@ -40,6 +40,11 @@ impl<'a> IoSliceMut<'a> { self.0 } + #[inline] + pub const fn into_slice(self) -> &'a mut [u8] { + self.0 + } + #[inline] pub fn as_mut_slice(&mut self) -> &mut [u8] { self.0