about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/call.rs
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/interpret/call.rs
parent68d2e8a66e0003178baf7dd9bbc62dc76f54a1af (diff)
downloadrust-c361c924a08c2e34c705ec3ee1ad2099315338d8.tar.gz
rust-c361c924a08c2e34c705ec3ee1ad2099315338d8.zip
Use assert_matches around the compiler
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/call.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/call.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/call.rs b/compiler/rustc_const_eval/src/interpret/call.rs
index fdbdfc7e1b8..917a2fa7c6d 100644
--- a/compiler/rustc_const_eval/src/interpret/call.rs
+++ b/compiler/rustc_const_eval/src/interpret/call.rs
@@ -1,5 +1,6 @@
 //! Manages calling a concrete function (with known MIR body) with argument passing,
 //! and returning the return value to the caller.
+use std::assert_matches::assert_matches;
 use std::borrow::Cow;
 
 use either::{Left, Right};
@@ -557,7 +558,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
                     unwind,
                 )? {
                     assert!(!self.tcx.intrinsic(fallback.def_id()).unwrap().must_be_overridden);
-                    assert!(matches!(fallback.def, ty::InstanceKind::Item(_)));
+                    assert_matches!(fallback.def, ty::InstanceKind::Item(_));
                     return self.init_fn_call(
                         FnVal::Instance(fallback),
                         (caller_abi, caller_fn_abi),