File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ libloading = "0.8"
43
43
[target .'cfg(target_family = "windows")' .dependencies ]
44
44
windows-sys = { version = " 0.59" , features = [
45
45
" Win32_Foundation" ,
46
- " Win32_Security" ,
47
46
" Win32_System_IO" ,
48
47
" Win32_Storage_FileSystem" ,
49
48
] }
Original file line number Diff line number Diff line change @@ -251,18 +251,18 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
251
251
}
252
252
253
253
let handle = if is_dir {
254
- let fh = & mut this . machine . fds ;
255
- let fd_num = fh . insert_new ( DirHandle { path : file_name } ) ;
254
+ // Open this as a directory.
255
+ let fd_num = this . machine . fds . insert_new ( DirHandle { path : file_name } ) ;
256
256
Ok ( Handle :: File ( fd_num) )
257
257
} else if creation_disposition == OpenExisting && !( desired_read || desired_write) {
258
258
// Windows supports handles with no permissions. These allow things such as reading
259
259
// metadata, but not file content.
260
- let fh = & mut this. machine . fds ;
261
260
file_name. metadata ( ) . map ( |meta| {
262
- let fd_num = fh . insert_new ( MetadataHandle { meta } ) ;
261
+ let fd_num = this . machine . fds . insert_new ( MetadataHandle { meta } ) ;
263
262
Handle :: File ( fd_num)
264
263
} )
265
264
} else {
265
+ // Open this as a standard file.
266
266
match creation_disposition {
267
267
CreateAlways | OpenAlways => {
268
268
options. create ( true ) ;
@@ -286,8 +286,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
286
286
}
287
287
288
288
options. open ( file_name) . map ( |file| {
289
- let fh = & mut this . machine . fds ;
290
- let fd_num = fh . insert_new ( FileHandle { file, writable : desired_write } ) ;
289
+ let fd_num =
290
+ this . machine . fds . insert_new ( FileHandle { file, writable : desired_write } ) ;
291
291
Handle :: File ( fd_num)
292
292
} )
293
293
} ;
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ mod utils;
17
17
18
18
fn main ( ) {
19
19
test_path_conversion ( ) ;
20
+ // Windows file handling is very incomplete.
20
21
if cfg ! ( not( windows) ) {
21
22
test_file ( ) ;
22
23
test_file_create_new ( ) ;
You can’t perform that action at this time.
0 commit comments