@@ -378,7 +378,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
378
378
// Reject if isolation is enabled.
379
379
if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
380
380
this. reject_in_isolation ( "`open`" , reject_with) ?;
381
- this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied ) ?;
381
+ this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied . into ( ) ) ?;
382
382
return Ok ( -1 ) ;
383
383
}
384
384
@@ -434,7 +434,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
434
434
// Reject if isolation is enabled.
435
435
if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
436
436
this. reject_in_isolation ( "`unlink`" , reject_with) ?;
437
- this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied ) ?;
437
+ this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied . into ( ) ) ?;
438
438
return Ok ( -1 ) ;
439
439
}
440
440
@@ -465,7 +465,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
465
465
// Reject if isolation is enabled.
466
466
if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
467
467
this. reject_in_isolation ( "`symlink`" , reject_with) ?;
468
- this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied ) ?;
468
+ this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied . into ( ) ) ?;
469
469
return Ok ( -1 ) ;
470
470
}
471
471
@@ -766,7 +766,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
766
766
// Reject if isolation is enabled.
767
767
if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
768
768
this. reject_in_isolation ( "`rename`" , reject_with) ?;
769
- this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied ) ?;
769
+ this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied . into ( ) ) ?;
770
770
return Ok ( -1 ) ;
771
771
}
772
772
@@ -794,7 +794,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
794
794
// Reject if isolation is enabled.
795
795
if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
796
796
this. reject_in_isolation ( "`mkdir`" , reject_with) ?;
797
- this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied ) ?;
797
+ this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied . into ( ) ) ?;
798
798
return Ok ( -1 ) ;
799
799
}
800
800
@@ -822,7 +822,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
822
822
// Reject if isolation is enabled.
823
823
if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
824
824
this. reject_in_isolation ( "`rmdir`" , reject_with) ?;
825
- this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied ) ?;
825
+ this. set_last_error_from_io_error ( ErrorKind :: PermissionDenied . into ( ) ) ?;
826
826
return Ok ( -1 ) ;
827
827
}
828
828
@@ -859,7 +859,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
859
859
Ok ( Scalar :: from_target_usize ( id, this) )
860
860
}
861
861
Err ( e) => {
862
- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
862
+ this. set_last_error_from_io_error ( e) ?;
863
863
Ok ( Scalar :: null_ptr ( this) )
864
864
}
865
865
}
@@ -947,7 +947,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
947
947
None
948
948
}
949
949
Some ( Err ( e) ) => {
950
- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
950
+ this. set_last_error_from_io_error ( e) ?;
951
951
None
952
952
}
953
953
} ;
@@ -1299,7 +1299,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1299
1299
Ok ( path_bytes. len ( ) . try_into ( ) . unwrap ( ) )
1300
1300
}
1301
1301
Err ( e) => {
1302
- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
1302
+ this. set_last_error_from_io_error ( e) ?;
1303
1303
Ok ( -1 )
1304
1304
}
1305
1305
}
@@ -1382,7 +1382,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1382
1382
Ok ( Scalar :: from_maybe_pointer ( dest, this) )
1383
1383
}
1384
1384
Err ( e) => {
1385
- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
1385
+ this. set_last_error_from_io_error ( e) ?;
1386
1386
Ok ( Scalar :: from_target_usize ( 0 , this) )
1387
1387
}
1388
1388
}
@@ -1503,7 +1503,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1503
1503
_ => {
1504
1504
// "On error, -1 is returned, and errno is set to
1505
1505
// indicate the error"
1506
- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
1506
+ this. set_last_error_from_io_error ( e) ?;
1507
1507
return Ok ( -1 ) ;
1508
1508
}
1509
1509
} ,
@@ -1582,7 +1582,7 @@ impl FileMetadata {
1582
1582
let metadata = match metadata {
1583
1583
Ok ( metadata) => metadata,
1584
1584
Err ( e) => {
1585
- ecx. set_last_error_from_io_error ( e. kind ( ) ) ?;
1585
+ ecx. set_last_error_from_io_error ( e) ?;
1586
1586
return Ok ( None ) ;
1587
1587
}
1588
1588
} ;
0 commit comments