Skip to content

Commit 823ef90

Browse files
authored
Rollup merge of #100158 - solid-rs:patch/kmc-solid/follow-up-98246, r=joshtriplett
kmc-solid: Add a stub implementation of #98246 (`File::set_times`) Fixes the build failure of the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets after #98246. This target does not support setting a modification time and access time separately, hence stubbing out the implementation.
2 parents 97440b5 + 0af4a28 commit 823ef90

File tree

1 file changed

+12
-0
lines changed
  • library/std/src/sys/solid

1 file changed

+12
-0
lines changed

library/std/src/sys/solid/fs.rs

+12
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ pub struct OpenOptions {
7777
custom_flags: i32,
7878
}
7979

80+
#[derive(Copy, Clone, Debug, Default)]
81+
pub struct FileTimes {}
82+
8083
#[derive(Clone, PartialEq, Eq, Debug)]
8184
pub struct FilePermissions(c_short);
8285

@@ -126,6 +129,11 @@ impl FilePermissions {
126129
}
127130
}
128131

132+
impl FileTimes {
133+
pub fn set_accessed(&mut self, _t: SystemTime) {}
134+
pub fn set_modified(&mut self, _t: SystemTime) {}
135+
}
136+
129137
impl FileType {
130138
pub fn is_dir(&self) -> bool {
131139
self.is(abi::S_IFDIR)
@@ -452,6 +460,10 @@ impl File {
452460
pub fn set_permissions(&self, _perm: FilePermissions) -> io::Result<()> {
453461
unsupported()
454462
}
463+
464+
pub fn set_times(&self, _times: FileTimes) -> io::Result<()> {
465+
unsupported()
466+
}
455467
}
456468

457469
impl Drop for File {

0 commit comments

Comments
 (0)