]> git.lizzy.rs Git - rust.git/commitdiff
Remove unnecessary cast
authorSamrat Man Singh <samratmansingh@gmail.com>
Sat, 18 Jul 2020 05:15:06 +0000 (10:45 +0530)
committerSamrat Man Singh <samratmansingh@gmail.com>
Sat, 18 Jul 2020 05:15:06 +0000 (10:45 +0530)
src/shims/posix/foreign_items.rs

index 81708e61b1ab5b3cacc97ba3fb5b5afbc84dda39..e0ad0d8d4112e619b7fd6164815f48e83e889323 100644 (file)
@@ -12,7 +12,6 @@
 use shims::posix::sync::EvalContextExt as _;
 use shims::posix::thread::EvalContextExt as _;
 
-
 impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
 pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
     fn emulate_foreign_item_by_name(
@@ -77,9 +76,6 @@ fn emulate_foreign_item_by_name(
                     // host's and target's `isize`. This saves us from
                     // having to handle overflows later.
                     let count = count.min(this.machine_isize_max() as u64).min(isize::MAX as u64);
-                    // This can never fail because `count` was capped
-                    // to be smaller than `isize::MAX`.
-                    let count = isize::try_from(count).unwrap();
 
                     // We want to read at most `count` bytes. We are
                     // sure that `count` is not negative because it