@@ -427,15 +427,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
427
427
428
428
// We cap the number of read bytes to the largest value that we are able to fit in both the
429
429
// host's and target's `isize`. This saves us from having to handle overflows later.
430
- let count = count. min ( this. isize_max ( ) as u64 ) . min ( isize:: max_value ( ) as u64 ) ;
430
+ let count = count. min ( this. isize_max ( ) as u64 ) . min ( isize:: MAX as u64 ) ;
431
431
432
432
if let Some ( FileHandle { file, writable : _ } ) = this. machine . file_handler . handles . get_mut ( & fd) {
433
433
// This can never fail because `count` was capped to be smaller than
434
- // `isize::max_value() `.
434
+ // `isize::MAX `.
435
435
let count = isize:: try_from ( count) . unwrap ( ) ;
436
436
// We want to read at most `count` bytes. We are sure that `count` is not negative
437
437
// because it was a target's `usize`. Also we are sure that its smaller than
438
- // `usize::max_value() ` because it is a host's `isize`.
438
+ // `usize::MAX ` because it is a host's `isize`.
439
439
let mut bytes = vec ! [ 0 ; count as usize ] ;
440
440
let result = file
441
441
. read ( & mut bytes)
@@ -481,7 +481,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
481
481
482
482
// We cap the number of written bytes to the largest value that we are able to fit in both the
483
483
// host's and target's `isize`. This saves us from having to handle overflows later.
484
- let count = count. min ( this. isize_max ( ) as u64 ) . min ( isize:: max_value ( ) as u64 ) ;
484
+ let count = count. min ( this. isize_max ( ) as u64 ) . min ( isize:: MAX as u64 ) ;
485
485
486
486
if let Some ( FileHandle { file, writable : _ } ) = this. machine . file_handler . handles . get_mut ( & fd) {
487
487
let bytes = this. memory . read_bytes ( buf, Size :: from_bytes ( count) ) ?;
0 commit comments