@@ -576,13 +576,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
576576
577577 let communicate = this. machine . communicate ( ) ;
578578
579- let Some ( mut file_descriptor ) = this. machine . fds . get_mut ( fd) else {
579+ let Some ( mut file_description ) = this. machine . fds . get_mut ( fd) else {
580580 return Ok ( Scalar :: from_i64 ( this. fd_not_found ( ) ?) ) ;
581581 } ;
582- let result = file_descriptor
582+ let result = file_description
583583 . seek ( communicate, seek_from) ?
584584 . map ( |offset| i64:: try_from ( offset) . unwrap ( ) ) ;
585- drop ( file_descriptor ) ;
585+ drop ( file_description ) ;
586586
587587 let result = this. try_unwrap_io_result ( result) ?;
588588 Ok ( Scalar :: from_i64 ( result) )
@@ -1269,30 +1269,30 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
12691269 return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
12701270 }
12711271
1272- let Some ( file_descriptor ) = this. machine . fds . get ( fd) else {
1272+ let Some ( file_description ) = this. machine . fds . get ( fd) else {
12731273 return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
12741274 } ;
12751275
12761276 // FIXME: Support ftruncate64 for all FDs
12771277 let FileHandle { file, writable } =
1278- file_descriptor . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1278+ file_description . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
12791279 err_unsup_format ! ( "`ftruncate64` is only supported on file-backed file descriptors" )
12801280 } ) ?;
12811281
12821282 if * writable {
12831283 if let Ok ( length) = length. try_into ( ) {
12841284 let result = file. set_len ( length) ;
1285- drop ( file_descriptor ) ;
1285+ drop ( file_description ) ;
12861286 let result = this. try_unwrap_io_result ( result. map ( |_| 0i32 ) ) ?;
12871287 Ok ( Scalar :: from_i32 ( result) )
12881288 } else {
1289- drop ( file_descriptor ) ;
1289+ drop ( file_description ) ;
12901290 let einval = this. eval_libc ( "EINVAL" ) ;
12911291 this. set_last_error ( einval) ?;
12921292 Ok ( Scalar :: from_i32 ( -1 ) )
12931293 }
12941294 } else {
1295- drop ( file_descriptor ) ;
1295+ drop ( file_description ) ;
12961296 // The file is not writable
12971297 let einval = this. eval_libc ( "EINVAL" ) ;
12981298 this. set_last_error ( einval) ?;
@@ -1322,16 +1322,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
13221322
13231323 fn ffullsync_fd ( & mut self , fd : i32 ) -> InterpResult < ' tcx , i32 > {
13241324 let this = self . eval_context_mut ( ) ;
1325- let Some ( file_descriptor ) = this. machine . fds . get ( fd) else {
1325+ let Some ( file_description ) = this. machine . fds . get ( fd) else {
13261326 return Ok ( this. fd_not_found ( ) ?) ;
13271327 } ;
13281328 // Only regular files support synchronization.
13291329 let FileHandle { file, writable } =
1330- file_descriptor . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1330+ file_description . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
13311331 err_unsup_format ! ( "`fsync` is only supported on file-backed file descriptors" )
13321332 } ) ?;
13331333 let io_result = maybe_sync_file ( file, * writable, File :: sync_all) ;
1334- drop ( file_descriptor ) ;
1334+ drop ( file_description ) ;
13351335 this. try_unwrap_io_result ( io_result)
13361336 }
13371337
@@ -1347,16 +1347,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
13471347 return this. fd_not_found ( ) ;
13481348 }
13491349
1350- let Some ( file_descriptor ) = this. machine . fds . get ( fd) else {
1350+ let Some ( file_description ) = this. machine . fds . get ( fd) else {
13511351 return Ok ( this. fd_not_found ( ) ?) ;
13521352 } ;
13531353 // Only regular files support synchronization.
13541354 let FileHandle { file, writable } =
1355- file_descriptor . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1355+ file_description . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
13561356 err_unsup_format ! ( "`fdatasync` is only supported on file-backed file descriptors" )
13571357 } ) ?;
13581358 let io_result = maybe_sync_file ( file, * writable, File :: sync_data) ;
1359- drop ( file_descriptor ) ;
1359+ drop ( file_description ) ;
13601360 this. try_unwrap_io_result ( io_result)
13611361 }
13621362
@@ -1395,18 +1395,18 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
13951395 return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
13961396 }
13971397
1398- let Some ( file_descriptor ) = this. machine . fds . get ( fd) else {
1398+ let Some ( file_description ) = this. machine . fds . get ( fd) else {
13991399 return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
14001400 } ;
14011401 // Only regular files support synchronization.
14021402 let FileHandle { file, writable } =
1403- file_descriptor . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1403+ file_description . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
14041404 err_unsup_format ! (
14051405 "`sync_data_range` is only supported on file-backed file descriptors"
14061406 )
14071407 } ) ?;
14081408 let io_result = maybe_sync_file ( file, * writable, File :: sync_data) ;
1409- drop ( file_descriptor ) ;
1409+ drop ( file_description ) ;
14101410 Ok ( Scalar :: from_i32 ( this. try_unwrap_io_result ( io_result) ?) )
14111411 }
14121412
@@ -1702,11 +1702,11 @@ impl FileMetadata {
17021702 ecx : & mut MiriInterpCx < ' tcx > ,
17031703 fd : i32 ,
17041704 ) -> InterpResult < ' tcx , Option < FileMetadata > > {
1705- let Some ( file_descriptor ) = ecx. machine . fds . get ( fd) else {
1705+ let Some ( file_description ) = ecx. machine . fds . get ( fd) else {
17061706 return ecx. fd_not_found ( ) . map ( |_: i32 | None ) ;
17071707 } ;
17081708
1709- let file = & file_descriptor
1709+ let file = & file_description
17101710 . downcast_ref :: < FileHandle > ( )
17111711 . ok_or_else ( || {
17121712 err_unsup_format ! (
@@ -1716,7 +1716,7 @@ impl FileMetadata {
17161716 . file ;
17171717
17181718 let metadata = file. metadata ( ) ;
1719- drop ( file_descriptor ) ;
1719+ drop ( file_description ) ;
17201720 FileMetadata :: from_meta ( ecx, metadata)
17211721 }
17221722
0 commit comments