Skip to content

Commit 3871203

Browse files
committed
Stabilize "file_lock" feature
1 parent 38c41d0 commit 3871203

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

library/std/src/fs.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub struct File {
121121
///
122122
/// [`try_lock`]: File::try_lock
123123
/// [`try_lock_shared`]: File::try_lock_shared
124-
#[unstable(feature = "file_lock", issue = "130994")]
124+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
125125
pub enum TryLockError {
126126
/// The lock could not be acquired due to an I/O error on the file. The standard library will
127127
/// not return an [`ErrorKind::WouldBlock`] error inside [`TryLockError::Error`]
@@ -366,10 +366,10 @@ pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> io::Result
366366
inner(path.as_ref(), contents.as_ref())
367367
}
368368

369-
#[unstable(feature = "file_lock", issue = "130994")]
369+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
370370
impl error::Error for TryLockError {}
371371

372-
#[unstable(feature = "file_lock", issue = "130994")]
372+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
373373
impl fmt::Debug for TryLockError {
374374
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
375375
match self {
@@ -379,7 +379,7 @@ impl fmt::Debug for TryLockError {
379379
}
380380
}
381381

382-
#[unstable(feature = "file_lock", issue = "130994")]
382+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
383383
impl fmt::Display for TryLockError {
384384
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
385385
match self {
@@ -390,7 +390,7 @@ impl fmt::Display for TryLockError {
390390
}
391391
}
392392

393-
#[unstable(feature = "file_lock", issue = "130994")]
393+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
394394
impl From<TryLockError> for io::Error {
395395
fn from(err: TryLockError) -> io::Error {
396396
match err {
@@ -713,7 +713,6 @@ impl File {
713713
/// # Examples
714714
///
715715
/// ```no_run
716-
/// #![feature(file_lock)]
717716
/// use std::fs::File;
718717
///
719718
/// fn main() -> std::io::Result<()> {
@@ -722,7 +721,7 @@ impl File {
722721
/// Ok(())
723722
/// }
724723
/// ```
725-
#[unstable(feature = "file_lock", issue = "130994")]
724+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
726725
pub fn lock(&self) -> io::Result<()> {
727726
self.inner.lock()
728727
}
@@ -766,7 +765,6 @@ impl File {
766765
/// # Examples
767766
///
768767
/// ```no_run
769-
/// #![feature(file_lock)]
770768
/// use std::fs::File;
771769
///
772770
/// fn main() -> std::io::Result<()> {
@@ -775,7 +773,7 @@ impl File {
775773
/// Ok(())
776774
/// }
777775
/// ```
778-
#[unstable(feature = "file_lock", issue = "130994")]
776+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
779777
pub fn lock_shared(&self) -> io::Result<()> {
780778
self.inner.lock_shared()
781779
}
@@ -824,7 +822,6 @@ impl File {
824822
/// # Examples
825823
///
826824
/// ```no_run
827-
/// #![feature(file_lock)]
828825
/// use std::fs::{File, TryLockError};
829826
///
830827
/// fn main() -> std::io::Result<()> {
@@ -840,7 +837,7 @@ impl File {
840837
/// Ok(())
841838
/// }
842839
/// ```
843-
#[unstable(feature = "file_lock", issue = "130994")]
840+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
844841
pub fn try_lock(&self) -> Result<(), TryLockError> {
845842
self.inner.try_lock()
846843
}
@@ -888,7 +885,6 @@ impl File {
888885
/// # Examples
889886
///
890887
/// ```no_run
891-
/// #![feature(file_lock)]
892888
/// use std::fs::{File, TryLockError};
893889
///
894890
/// fn main() -> std::io::Result<()> {
@@ -905,7 +901,7 @@ impl File {
905901
/// Ok(())
906902
/// }
907903
/// ```
908-
#[unstable(feature = "file_lock", issue = "130994")]
904+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
909905
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
910906
self.inner.try_lock_shared()
911907
}
@@ -933,7 +929,6 @@ impl File {
933929
/// # Examples
934930
///
935931
/// ```no_run
936-
/// #![feature(file_lock)]
937932
/// use std::fs::File;
938933
///
939934
/// fn main() -> std::io::Result<()> {
@@ -943,7 +938,7 @@ impl File {
943938
/// Ok(())
944939
/// }
945940
/// ```
946-
#[unstable(feature = "file_lock", issue = "130994")]
941+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
947942
pub fn unlock(&self) -> io::Result<()> {
948943
self.inner.unlock()
949944
}

src/tools/miri/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#![feature(unqualified_local_imports)]
1717
#![feature(derive_coerce_pointee)]
1818
#![feature(arbitrary_self_types)]
19-
#![feature(file_lock)]
19+
#![cfg_attr(bootstrap, feature(file_lock))]
2020
// Configure clippy and other lints
2121
#![allow(
2222
clippy::collapsible_else_if,

src/tools/miri/tests/pass/shims/fs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#![feature(io_error_more)]
44
#![feature(io_error_uncategorized)]
5-
#![feature(file_lock)]
65

76
use std::collections::BTreeMap;
87
use std::ffi::OsString;

0 commit comments

Comments
 (0)