about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/check_consts
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-08-11 12:10:36 -0400
committerMichael Goulet <michael@errs.io>2024-08-11 12:25:39 -0400
commitc361c924a08c2e34c705ec3ee1ad2099315338d8 (patch)
treebaf77b91e85e7f6ef791733caa6ca797b4093b39 /compiler/rustc_const_eval/src/check_consts
parent68d2e8a66e0003178baf7dd9bbc62dc76f54a1af (diff)
downloadrust-c361c924a08c2e34c705ec3ee1ad2099315338d8.tar.gz
rust-c361c924a08c2e34c705ec3ee1ad2099315338d8.zip
Use assert_matches around the compiler
Diffstat (limited to 'compiler/rustc_const_eval/src/check_consts')
-rw-r--r--compiler/rustc_const_eval/src/check_consts/check.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs
index 3ded81b90ff..844f3f3d611 100644
--- a/compiler/rustc_const_eval/src/check_consts/check.rs
+++ b/compiler/rustc_const_eval/src/check_consts/check.rs
@@ -1,5 +1,6 @@
 //! The `Visitor` responsible for actually checking a `mir::Body` for invalid operations.
 
+use std::assert_matches::assert_matches;
 use std::mem;
 use std::ops::Deref;
 
@@ -590,7 +591,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                 if is_int_bool_or_char(lhs_ty) && is_int_bool_or_char(rhs_ty) {
                     // Int, bool, and char operations are fine.
                 } else if lhs_ty.is_fn_ptr() || lhs_ty.is_unsafe_ptr() {
-                    assert!(matches!(
+                    assert_matches!(
                         op,
                         BinOp::Eq
                             | BinOp::Ne
@@ -599,7 +600,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                             | BinOp::Ge
                             | BinOp::Gt
                             | BinOp::Offset
-                    ));
+                    );
 
                     self.check_op(ops::RawPtrComparison);
                 } else if lhs_ty.is_floating_point() || rhs_ty.is_floating_point() {