|
2 | 2 |
|
3 | 3 | use std::borrow::Cow;
|
4 | 4 | use std::fs::{
|
5 |
| - read_dir, remove_dir, remove_file, rename, DirBuilder, File, FileType, OpenOptions, ReadDir, |
| 5 | + DirBuilder, File, FileType, OpenOptions, ReadDir, read_dir, remove_dir, remove_file, rename, |
6 | 6 | };
|
7 | 7 | use std::io::{self, ErrorKind, IsTerminal, Read, Seek, SeekFrom, Write};
|
8 | 8 | use std::path::{Path, PathBuf};
|
@@ -203,7 +203,7 @@ impl FileDescription for FileHandle {
|
203 | 203 | ERROR_IO_PENDING, ERROR_LOCK_VIOLATION, FALSE, HANDLE, TRUE,
|
204 | 204 | };
|
205 | 205 | use windows_sys::Win32::Storage::FileSystem::{
|
206 |
| - LockFileEx, UnlockFile, LOCKFILE_EXCLUSIVE_LOCK, LOCKFILE_FAIL_IMMEDIATELY, |
| 206 | + LOCKFILE_EXCLUSIVE_LOCK, LOCKFILE_FAIL_IMMEDIATELY, LockFileEx, UnlockFile, |
207 | 207 | };
|
208 | 208 |
|
209 | 209 | let fh = self.file.as_raw_handle() as HANDLE;
|
@@ -632,11 +632,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
632 | 632 | #[cfg(windows)]
|
633 | 633 | fn create_link(src: &Path, dst: &Path) -> std::io::Result<()> {
|
634 | 634 | use std::os::windows::fs;
|
635 |
| - if src.is_dir() { |
636 |
| - fs::symlink_dir(src, dst) |
637 |
| - } else { |
638 |
| - fs::symlink_file(src, dst) |
639 |
| - } |
| 635 | + if src.is_dir() { fs::symlink_dir(src, dst) } else { fs::symlink_file(src, dst) } |
640 | 636 | }
|
641 | 637 |
|
642 | 638 | let this = self.eval_context_mut();
|
@@ -1227,13 +1223,17 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
1227 | 1223 | this.write_null(&this.deref_pointer(result_op)?)?;
|
1228 | 1224 | 0
|
1229 | 1225 | }
|
1230 |
| - Some(Err(e)) => match e.raw_os_error() { |
1231 |
| - // return positive error number on error |
1232 |
| - Some(error) => error, |
1233 |
| - None => { |
1234 |
| - throw_unsup_format!("the error {} couldn't be converted to a return value", e) |
1235 |
| - } |
1236 |
| - }, |
| 1226 | + Some(Err(e)) => |
| 1227 | + match e.raw_os_error() { |
| 1228 | + // return positive error number on error |
| 1229 | + Some(error) => error, |
| 1230 | + None => { |
| 1231 | + throw_unsup_format!( |
| 1232 | + "the error {} couldn't be converted to a return value", |
| 1233 | + e |
| 1234 | + ) |
| 1235 | + } |
| 1236 | + }, |
1237 | 1237 | }))
|
1238 | 1238 | }
|
1239 | 1239 |
|
@@ -1432,7 +1432,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
1432 | 1432 | this.write_bytes_ptr(buf, path_bytes.iter().copied())?;
|
1433 | 1433 | interp_ok(path_bytes.len().try_into().unwrap())
|
1434 | 1434 | }
|
1435 |
| - Err(e) => Ok(this.set_last_error_and_return_i64(e)), |
| 1435 | + Err(e) => this.set_last_error_and_return_i64(e), |
1436 | 1436 | }
|
1437 | 1437 | }
|
1438 | 1438 |
|
|
0 commit comments