Skip to content

Commit 3f59916

Browse files
authored
Rollup merge of #138822 - moxian:unlock, r=joshtriplett
De-Stabilize `file_lock` This reverts #136794 FCP on the tracking issue (#130994) passsed successfully #130994 (comment) but there are now concerns about the suitability of the proposed API (#130994 (comment)) On zullip it was [suggested](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/File.3A.3Atry_lock.20API.3A.20Result.3Cbool.3E/near/506823067) that it would be better to temporarily(?) destabilize the feature ASAP to buy us some more time reflecting on the API. This PR implements the revert. The feature is not currently on beta (https://github.com/rust-lang/rust/blob/beta/library/std/src/fs.rs#L672) so a beta backport is not yet neccessary. If this revert is accepted, the tracking issue (#130994) should be reopened
2 parents 7372f28 + 110f1fe commit 3f59916

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

library/std/src/fs.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ impl File {
665665
/// # Examples
666666
///
667667
/// ```no_run
668+
/// #![feature(file_lock)]
668669
/// use std::fs::File;
669670
///
670671
/// fn main() -> std::io::Result<()> {
@@ -673,7 +674,7 @@ impl File {
673674
/// Ok(())
674675
/// }
675676
/// ```
676-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
677+
#[unstable(feature = "file_lock", issue = "130994")]
677678
pub fn lock(&self) -> io::Result<()> {
678679
self.inner.lock()
679680
}
@@ -717,6 +718,7 @@ impl File {
717718
/// # Examples
718719
///
719720
/// ```no_run
721+
/// #![feature(file_lock)]
720722
/// use std::fs::File;
721723
///
722724
/// fn main() -> std::io::Result<()> {
@@ -725,7 +727,7 @@ impl File {
725727
/// Ok(())
726728
/// }
727729
/// ```
728-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
730+
#[unstable(feature = "file_lock", issue = "130994")]
729731
pub fn lock_shared(&self) -> io::Result<()> {
730732
self.inner.lock_shared()
731733
}
@@ -774,6 +776,7 @@ impl File {
774776
/// # Examples
775777
///
776778
/// ```no_run
779+
/// #![feature(file_lock)]
777780
/// use std::fs::File;
778781
///
779782
/// fn main() -> std::io::Result<()> {
@@ -782,7 +785,7 @@ impl File {
782785
/// Ok(())
783786
/// }
784787
/// ```
785-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
788+
#[unstable(feature = "file_lock", issue = "130994")]
786789
pub fn try_lock(&self) -> io::Result<bool> {
787790
self.inner.try_lock()
788791
}
@@ -830,6 +833,7 @@ impl File {
830833
/// # Examples
831834
///
832835
/// ```no_run
836+
/// #![feature(file_lock)]
833837
/// use std::fs::File;
834838
///
835839
/// fn main() -> std::io::Result<()> {
@@ -838,7 +842,7 @@ impl File {
838842
/// Ok(())
839843
/// }
840844
/// ```
841-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
845+
#[unstable(feature = "file_lock", issue = "130994")]
842846
pub fn try_lock_shared(&self) -> io::Result<bool> {
843847
self.inner.try_lock_shared()
844848
}
@@ -866,6 +870,7 @@ impl File {
866870
/// # Examples
867871
///
868872
/// ```no_run
873+
/// #![feature(file_lock)]
869874
/// use std::fs::File;
870875
///
871876
/// fn main() -> std::io::Result<()> {
@@ -875,7 +880,7 @@ impl File {
875880
/// Ok(())
876881
/// }
877882
/// ```
878-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
883+
#[unstable(feature = "file_lock", issue = "130994")]
879884
pub fn unlock(&self) -> io::Result<()> {
880885
self.inner.unlock()
881886
}

0 commit comments

Comments
 (0)