@@ -240,25 +240,25 @@ impl FdTable {
240240 }
241241 pub ( crate ) fn init ( mute_stdout_stderr : bool ) -> FdTable {
242242 let mut fds = FdTable :: new ( ) ;
243- fds. insert_fd ( io:: stdin ( ) ) ;
243+ fds. insert_new ( io:: stdin ( ) ) ;
244244 if mute_stdout_stderr {
245- assert_eq ! ( fds. insert_fd ( NullOutput ) , 1 ) ;
246- assert_eq ! ( fds. insert_fd ( NullOutput ) , 2 ) ;
245+ assert_eq ! ( fds. insert_new ( NullOutput ) , 1 ) ;
246+ assert_eq ! ( fds. insert_new ( NullOutput ) , 2 ) ;
247247 } else {
248- assert_eq ! ( fds. insert_fd ( io:: stdout( ) ) , 1 ) ;
249- assert_eq ! ( fds. insert_fd ( io:: stderr( ) ) , 2 ) ;
248+ assert_eq ! ( fds. insert_new ( io:: stdout( ) ) , 1 ) ;
249+ assert_eq ! ( fds. insert_new ( io:: stderr( ) ) , 2 ) ;
250250 }
251251 fds
252252 }
253253
254254 /// Insert a new file description to the FdTable.
255- pub fn insert_fd ( & mut self , fd : impl FileDescription ) -> i32 {
255+ pub fn insert_new ( & mut self , fd : impl FileDescription ) -> i32 {
256256 let file_handle = FileDescriptionRef :: new ( fd) ;
257- self . insert_fd_with_min_fd ( file_handle, 0 )
257+ self . insert_ref_with_min_fd ( file_handle, 0 )
258258 }
259259
260- /// Insert a new FD that is at least `min_fd`.
261- fn insert_fd_with_min_fd ( & mut self , file_handle : FileDescriptionRef , min_fd : i32 ) -> i32 {
260+ /// Insert a file description, giving it a file descriptor that is at least `min_fd`.
261+ fn insert_ref_with_min_fd ( & mut self , file_handle : FileDescriptionRef , min_fd : i32 ) -> i32 {
262262 // Find the lowest unused FD, starting from min_fd. If the first such unused FD is in
263263 // between used FDs, the find_map combinator will return it. If the first such unused FD
264264 // is after all other used FDs, the find_map combinator will return None, and we will use
@@ -316,7 +316,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
316316 let Some ( dup_fd) = this. machine . fds . dup ( old_fd) else {
317317 return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
318318 } ;
319- Ok ( Scalar :: from_i32 ( this. machine . fds . insert_fd_with_min_fd ( dup_fd, 0 ) ) )
319+ Ok ( Scalar :: from_i32 ( this. machine . fds . insert_ref_with_min_fd ( dup_fd, 0 ) ) )
320320 }
321321
322322 fn dup2 ( & mut self , old_fd : i32 , new_fd : i32 ) -> InterpResult < ' tcx , Scalar > {
@@ -410,7 +410,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
410410
411411 match this. machine . fds . dup ( fd) {
412412 Some ( dup_fd) =>
413- Ok ( Scalar :: from_i32 ( this. machine . fds . insert_fd_with_min_fd ( dup_fd, start) ) ) ,
413+ Ok ( Scalar :: from_i32 ( this. machine . fds . insert_ref_with_min_fd ( dup_fd, start) ) ) ,
414414 None => Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ,
415415 }
416416 } else if this. tcx . sess . target . os == "macos" && cmd == this. eval_libc_i32 ( "F_FULLFSYNC" ) {
0 commit comments