Skip to content

Commit 230a1d6

Browse files
committed
Fix unix file description metadata
1 parent f6eb3bd commit 230a1d6

File tree

1 file changed

+5
-3
lines changed
  • src/tools/miri/src/shims/unix

1 file changed

+5
-3
lines changed

src/tools/miri/src/shims/unix/fs.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
//! File and file system access
22
33
use std::borrow::Cow;
4-
use std::fs::{
5-
DirBuilder, File, FileType, OpenOptions, ReadDir, read_dir, remove_dir, remove_file, rename,
6-
};
4+
use std::fs::{DirBuilder, File, FileType, OpenOptions, ReadDir, read_dir, remove_dir, remove_file, rename, Metadata};
75
use std::io::{self, ErrorKind, IsTerminal, Read, Seek, SeekFrom, Write};
86
use std::path::{Path, PathBuf};
97
use std::time::SystemTime;
@@ -100,6 +98,10 @@ impl FileDescription for FileHandle {
10098
}
10199
}
102100

101+
fn metadata<'tcx>(&self) -> InterpResult<'tcx, io::Result<Metadata>> {
102+
interp_ok(self.file.metadata())
103+
}
104+
103105
fn is_tty(&self, communicate_allowed: bool) -> bool {
104106
communicate_allowed && self.file.is_terminal()
105107
}

0 commit comments

Comments
 (0)