Skip to content

Commit 0454dab

Browse files
committed
Auto merge of #1479 - RalfJung:fs-nocast, r=RalfJung
fs: remove an unnecessary intermediate cast
2 parents e5f2b1b + c28786d commit 0454dab

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/shims/posix/fs.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
461461

462462
if let Some(FileHandle { file, writable: _ }) = this.machine.file_handler.handles.get_mut(&fd) {
463463
trace!("read: FD mapped to {:?}", file);
464-
// This can never fail because `count` was capped to be smaller than
465-
// `isize::MAX`.
466-
let count = isize::try_from(count).unwrap();
467464
// We want to read at most `count` bytes. We are sure that `count` is not negative
468465
// because it was a target's `usize`. Also we are sure that its smaller than
469466
// `usize::MAX` because it is a host's `isize`.

0 commit comments

Comments
 (0)