diff options
Diffstat (limited to 'compiler/rustc_mir/src/interpret/memory.rs')
| -rw-r--r-- | compiler/rustc_mir/src/interpret/memory.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/compiler/rustc_mir/src/interpret/memory.rs b/compiler/rustc_mir/src/interpret/memory.rs index fe5ebf0b6fe..3648748a909 100644 --- a/compiler/rustc_mir/src/interpret/memory.rs +++ b/compiler/rustc_mir/src/interpret/memory.rs @@ -854,11 +854,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { Some(ptr) => ptr, None => { // zero-sized access - assert_matches!( - src.next(), - None, - "iterator said it was empty but returned an element" - ); + assert!(src.next().is_none(), "iterator said it was empty but returned an element"); return Ok(()); } }; @@ -884,11 +880,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { Some(ptr) => ptr, None => { // zero-sized access - assert_matches!( - src.next(), - None, - "iterator said it was empty but returned an element" - ); + assert!(src.next().is_none(), "iterator said it was empty but returned an element"); return Ok(()); } }; @@ -902,7 +894,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { let offset_ptr = ptr.offset(Size::from_bytes(idx) * 2, &tcx)?; // `Size` multiplication allocation.write_scalar(&tcx, offset_ptr, val.into(), Size::from_bytes(2))?; } - assert_matches!(src.next(), None, "iterator was longer than it said it would be"); + assert!(src.next().is_none(), "iterator was longer than it said it would be"); Ok(()) } |
