@@ -378,7 +378,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
378378 // Reject if isolation is enabled.
379379 if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
380380 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 ( ) ) ?;
382382 return Ok ( -1 ) ;
383383 }
384384
@@ -434,7 +434,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
434434 // Reject if isolation is enabled.
435435 if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
436436 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 ( ) ) ?;
438438 return Ok ( -1 ) ;
439439 }
440440
@@ -465,7 +465,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
465465 // Reject if isolation is enabled.
466466 if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
467467 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 ( ) ) ?;
469469 return Ok ( -1 ) ;
470470 }
471471
@@ -766,7 +766,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
766766 // Reject if isolation is enabled.
767767 if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
768768 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 ( ) ) ?;
770770 return Ok ( -1 ) ;
771771 }
772772
@@ -794,7 +794,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
794794 // Reject if isolation is enabled.
795795 if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
796796 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 ( ) ) ?;
798798 return Ok ( -1 ) ;
799799 }
800800
@@ -822,7 +822,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
822822 // Reject if isolation is enabled.
823823 if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
824824 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 ( ) ) ?;
826826 return Ok ( -1 ) ;
827827 }
828828
@@ -859,7 +859,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
859859 Ok ( Scalar :: from_target_usize ( id, this) )
860860 }
861861 Err ( e) => {
862- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
862+ this. set_last_error_from_io_error ( e) ?;
863863 Ok ( Scalar :: null_ptr ( this) )
864864 }
865865 }
@@ -947,7 +947,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
947947 None
948948 }
949949 Some ( Err ( e) ) => {
950- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
950+ this. set_last_error_from_io_error ( e) ?;
951951 None
952952 }
953953 } ;
@@ -1299,7 +1299,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
12991299 Ok ( path_bytes. len ( ) . try_into ( ) . unwrap ( ) )
13001300 }
13011301 Err ( e) => {
1302- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
1302+ this. set_last_error_from_io_error ( e) ?;
13031303 Ok ( -1 )
13041304 }
13051305 }
@@ -1382,7 +1382,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
13821382 Ok ( Scalar :: from_maybe_pointer ( dest, this) )
13831383 }
13841384 Err ( e) => {
1385- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
1385+ this. set_last_error_from_io_error ( e) ?;
13861386 Ok ( Scalar :: from_target_usize ( 0 , this) )
13871387 }
13881388 }
@@ -1503,7 +1503,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
15031503 _ => {
15041504 // "On error, -1 is returned, and errno is set to
15051505 // indicate the error"
1506- this. set_last_error_from_io_error ( e. kind ( ) ) ?;
1506+ this. set_last_error_from_io_error ( e) ?;
15071507 return Ok ( -1 ) ;
15081508 }
15091509 } ,
@@ -1582,7 +1582,7 @@ impl FileMetadata {
15821582 let metadata = match metadata {
15831583 Ok ( metadata) => metadata,
15841584 Err ( e) => {
1585- ecx. set_last_error_from_io_error ( e. kind ( ) ) ?;
1585+ ecx. set_last_error_from_io_error ( e) ?;
15861586 return Ok ( None ) ;
15871587 }
15881588 } ;
0 commit comments