Skip to content

Commit 077e0cf

Browse files
committed
Stabilize "file_lock" feature
1 parent ebe9b00 commit 077e0cf

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
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`]
@@ -367,10 +367,10 @@ pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> io::Result
367367
inner(path.as_ref(), contents.as_ref())
368368
}
369369

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

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

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

394-
#[unstable(feature = "file_lock", issue = "130994")]
394+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
395395
impl From<TryLockError> for io::Error {
396396
fn from(err: TryLockError) -> io::Error {
397397
match err {
@@ -714,7 +714,6 @@ impl File {
714714
/// # Examples
715715
///
716716
/// ```no_run
717-
/// #![feature(file_lock)]
718717
/// use std::fs::File;
719718
///
720719
/// fn main() -> std::io::Result<()> {
@@ -723,7 +722,7 @@ impl File {
723722
/// Ok(())
724723
/// }
725724
/// ```
726-
#[unstable(feature = "file_lock", issue = "130994")]
725+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
727726
pub fn lock(&self) -> io::Result<()> {
728727
self.inner.lock()
729728
}
@@ -767,7 +766,6 @@ impl File {
767766
/// # Examples
768767
///
769768
/// ```no_run
770-
/// #![feature(file_lock)]
771769
/// use std::fs::File;
772770
///
773771
/// fn main() -> std::io::Result<()> {
@@ -776,7 +774,7 @@ impl File {
776774
/// Ok(())
777775
/// }
778776
/// ```
779-
#[unstable(feature = "file_lock", issue = "130994")]
777+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
780778
pub fn lock_shared(&self) -> io::Result<()> {
781779
self.inner.lock_shared()
782780
}
@@ -825,7 +823,6 @@ impl File {
825823
/// # Examples
826824
///
827825
/// ```no_run
828-
/// #![feature(file_lock)]
829826
/// use std::fs::{File, TryLockError};
830827
///
831828
/// fn main() -> std::io::Result<()> {
@@ -841,7 +838,7 @@ impl File {
841838
/// Ok(())
842839
/// }
843840
/// ```
844-
#[unstable(feature = "file_lock", issue = "130994")]
841+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
845842
pub fn try_lock(&self) -> Result<(), TryLockError> {
846843
self.inner.try_lock()
847844
}
@@ -889,7 +886,6 @@ impl File {
889886
/// # Examples
890887
///
891888
/// ```no_run
892-
/// #![feature(file_lock)]
893889
/// use std::fs::{File, TryLockError};
894890
///
895891
/// fn main() -> std::io::Result<()> {
@@ -906,7 +902,7 @@ impl File {
906902
/// Ok(())
907903
/// }
908904
/// ```
909-
#[unstable(feature = "file_lock", issue = "130994")]
905+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
910906
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
911907
self.inner.try_lock_shared()
912908
}
@@ -934,7 +930,6 @@ impl File {
934930
/// # Examples
935931
///
936932
/// ```no_run
937-
/// #![feature(file_lock)]
938933
/// use std::fs::File;
939934
///
940935
/// fn main() -> std::io::Result<()> {
@@ -944,7 +939,7 @@ impl File {
944939
/// Ok(())
945940
/// }
946941
/// ```
947-
#[unstable(feature = "file_lock", issue = "130994")]
942+
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
948943
pub fn unlock(&self) -> io::Result<()> {
949944
self.inner.unlock()
950945
}

0 commit comments

Comments
 (0)