Skip to content

Commit a2acc55

Browse files
committed
Stabilize file_set_times
Approved via FCP in #98245 .
1 parent a395214 commit a2acc55

File tree

5 files changed

+19
-21
lines changed

5 files changed

+19
-21
lines changed

library/std/src/fs.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub struct OpenOptions(fs_imp::OpenOptions);
189189

190190
/// Representation of the various timestamps on a file.
191191
#[derive(Copy, Clone, Debug, Default)]
192-
#[unstable(feature = "file_set_times", issue = "98245")]
192+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
193193
pub struct FileTimes(fs_imp::FileTimes);
194194

195195
/// Representation of the various permissions on a file.
@@ -676,8 +676,6 @@ impl File {
676676
/// # Examples
677677
///
678678
/// ```no_run
679-
/// #![feature(file_set_times)]
680-
///
681679
/// fn main() -> std::io::Result<()> {
682680
/// use std::fs::{self, File, FileTimes};
683681
///
@@ -690,7 +688,7 @@ impl File {
690688
/// Ok(())
691689
/// }
692690
/// ```
693-
#[unstable(feature = "file_set_times", issue = "98245")]
691+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
694692
#[doc(alias = "futimens")]
695693
#[doc(alias = "futimes")]
696694
#[doc(alias = "SetFileTime")]
@@ -701,7 +699,7 @@ impl File {
701699
/// Changes the modification time of the underlying file.
702700
///
703701
/// This is an alias for `set_times(FileTimes::new().set_modified(time))`.
704-
#[unstable(feature = "file_set_times", issue = "98245")]
702+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
705703
#[inline]
706704
pub fn set_modified(&self, time: SystemTime) -> io::Result<()> {
707705
self.set_times(FileTimes::new().set_modified(time))
@@ -1415,20 +1413,20 @@ impl FileTimes {
14151413
/// Create a new `FileTimes` with no times set.
14161414
///
14171415
/// Using the resulting `FileTimes` in [`File::set_times`] will not modify any timestamps.
1418-
#[unstable(feature = "file_set_times", issue = "98245")]
1416+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
14191417
pub fn new() -> Self {
14201418
Self::default()
14211419
}
14221420

14231421
/// Set the last access time of a file.
1424-
#[unstable(feature = "file_set_times", issue = "98245")]
1422+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
14251423
pub fn set_accessed(mut self, t: SystemTime) -> Self {
14261424
self.0.set_accessed(t.into_inner());
14271425
self
14281426
}
14291427

14301428
/// Set the last modified time of a file.
1431-
#[unstable(feature = "file_set_times", issue = "98245")]
1429+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
14321430
pub fn set_modified(mut self, t: SystemTime) -> Self {
14331431
self.0.set_modified(t.into_inner());
14341432
self
@@ -1442,7 +1440,7 @@ impl AsInnerMut<fs_imp::FileTimes> for FileTimes {
14421440
}
14431441

14441442
// For implementing OS extension traits in `std::os`
1445-
#[unstable(feature = "file_set_times", issue = "98245")]
1443+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
14461444
impl Sealed for FileTimes {}
14471445

14481446
impl Permissions {

library/std/src/os/ios/fs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ impl MetadataExt for Metadata {
144144
}
145145

146146
/// OS-specific extensions to [`fs::FileTimes`].
147-
#[unstable(feature = "file_set_times", issue = "98245")]
147+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
148148
pub trait FileTimesExt: Sealed {
149149
/// Set the creation time of a file.
150-
#[unstable(feature = "file_set_times", issue = "98245")]
150+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
151151
fn set_created(self, t: SystemTime) -> Self;
152152
}
153153

154-
#[unstable(feature = "file_set_times", issue = "98245")]
154+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
155155
impl FileTimesExt for fs::FileTimes {
156156
fn set_created(mut self, t: SystemTime) -> Self {
157157
self.as_inner_mut().set_created(t.into_inner());

library/std/src/os/macos/fs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ impl MetadataExt for Metadata {
150150
}
151151

152152
/// OS-specific extensions to [`fs::FileTimes`].
153-
#[unstable(feature = "file_set_times", issue = "98245")]
153+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
154154
pub trait FileTimesExt: Sealed {
155155
/// Set the creation time of a file.
156-
#[unstable(feature = "file_set_times", issue = "98245")]
156+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
157157
fn set_created(self, t: SystemTime) -> Self;
158158
}
159159

160-
#[unstable(feature = "file_set_times", issue = "98245")]
160+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
161161
impl FileTimesExt for fs::FileTimes {
162162
fn set_created(mut self, t: SystemTime) -> Self {
163163
self.as_inner_mut().set_created(t.into_inner());

library/std/src/os/watchos/fs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ impl MetadataExt for Metadata {
144144
}
145145

146146
/// OS-specific extensions to [`fs::FileTimes`].
147-
#[unstable(feature = "file_set_times", issue = "98245")]
147+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
148148
pub trait FileTimesExt: Sealed {
149149
/// Set the creation time of a file.
150-
#[unstable(feature = "file_set_times", issue = "98245")]
150+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
151151
fn set_created(self, t: SystemTime) -> Self;
152152
}
153153

154-
#[unstable(feature = "file_set_times", issue = "98245")]
154+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
155155
impl FileTimesExt for fs::FileTimes {
156156
fn set_created(mut self, t: SystemTime) -> Self {
157157
self.as_inner_mut().set_created(t.into_inner());

library/std/src/os/windows/fs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,14 @@ impl FileTypeExt for fs::FileType {
528528
}
529529

530530
/// Windows-specific extensions to [`fs::FileTimes`].
531-
#[unstable(feature = "file_set_times", issue = "98245")]
531+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
532532
pub trait FileTimesExt: Sealed {
533533
/// Set the creation time of a file.
534-
#[unstable(feature = "file_set_times", issue = "98245")]
534+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
535535
fn set_created(self, t: SystemTime) -> Self;
536536
}
537537

538-
#[unstable(feature = "file_set_times", issue = "98245")]
538+
#[stable(feature = "file_set_times", since = "CURRENT_RUSTC_VERSION")]
539539
impl FileTimesExt for fs::FileTimes {
540540
fn set_created(mut self, t: SystemTime) -> Self {
541541
self.as_inner_mut().set_created(t.into_inner());

0 commit comments

Comments
 (0)