Skip to content

Commit

Permalink
Rollup merge of rust-lang#100158 - solid-rs:patch/kmc-solid/follow-up…
Browse files Browse the repository at this point in the history
…-98246, r=joshtriplett

kmc-solid: Add a stub implementation of rust-lang#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 rust-lang#98246.

This target does not support setting a modification time and access time separately, hence stubbing out the implementation.
  • Loading branch information
Dylan-DPC authored Aug 5, 2022
2 parents 97440b5 + 0af4a28 commit 823ef90
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/std/src/sys/solid/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ pub struct OpenOptions {
custom_flags: i32,
}

#[derive(Copy, Clone, Debug, Default)]
pub struct FileTimes {}

#[derive(Clone, PartialEq, Eq, Debug)]
pub struct FilePermissions(c_short);

Expand Down Expand Up @@ -126,6 +129,11 @@ impl FilePermissions {
}
}

impl FileTimes {
pub fn set_accessed(&mut self, _t: SystemTime) {}
pub fn set_modified(&mut self, _t: SystemTime) {}
}

impl FileType {
pub fn is_dir(&self) -> bool {
self.is(abi::S_IFDIR)
Expand Down Expand Up @@ -452,6 +460,10 @@ impl File {
pub fn set_permissions(&self, _perm: FilePermissions) -> io::Result<()> {
unsupported()
}

pub fn set_times(&self, _times: FileTimes) -> io::Result<()> {
unsupported()
}
}

impl Drop for File {
Expand Down

0 comments on commit 823ef90

Please sign in to comment.