about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_middle/src/ich/impls_syntax.rs6
-rw-r--r--compiler/rustc_middle/src/mir/interpret/allocation.rs2
-rw-r--r--compiler/rustc_mir/src/interpret/memory.rs14
-rw-r--r--src/test/ui/macros/assert-matches-macro-msg.rs11
4 files changed, 5 insertions, 28 deletions
diff --git a/compiler/rustc_middle/src/ich/impls_syntax.rs b/compiler/rustc_middle/src/ich/impls_syntax.rs
index 31374429940..aacec860711 100644
--- a/compiler/rustc_middle/src/ich/impls_syntax.rs
+++ b/compiler/rustc_middle/src/ich/impls_syntax.rs
@@ -45,11 +45,7 @@ impl<'ctx> rustc_ast::HashStableContext for StableHashingContext<'ctx> {
             item.hash_stable(self, hasher);
             style.hash_stable(self, hasher);
             span.hash_stable(self, hasher);
-            assert_matches!(
-                tokens.as_ref(),
-                None,
-                "Tokens should have been removed during lowering!"
-            );
+            assert!(tokens.as_ref().is_none(), "Tokens should have been removed during lowering!");
         } else {
             unreachable!();
         }
diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs
index 766d6a06f7e..898c375e9ae 100644
--- a/compiler/rustc_middle/src/mir/interpret/allocation.rs
+++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs
@@ -339,7 +339,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
         for dest in bytes {
             *dest = src.next().expect("iterator was shorter than it said it would be");
         }
-        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(())
     }
 
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(())
     }
 
diff --git a/src/test/ui/macros/assert-matches-macro-msg.rs b/src/test/ui/macros/assert-matches-macro-msg.rs
deleted file mode 100644
index 43be9532f5d..00000000000
--- a/src/test/ui/macros/assert-matches-macro-msg.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// run-fail
-// error-pattern:panicked at 'assertion failed: `(left matches right)`
-// error-pattern: left: `2`
-// error-pattern:right: `3`: 1 + 1 definitely should be 3'
-// ignore-emscripten no processes
-
-#![feature(assert_matches)]
-
-fn main() {
-    assert_matches!(1 + 1, 3, "1 + 1 definitely should be 3");
-}