about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/impl_wf_check.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_hir_analysis/src/impl_wf_check.rs
parent68d2e8a66e0003178baf7dd9bbc62dc76f54a1af (diff)
downloadrust-c361c924a08c2e34c705ec3ee1ad2099315338d8.tar.gz
rust-c361c924a08c2e34c705ec3ee1ad2099315338d8.zip
Use assert_matches around the compiler
Diffstat (limited to 'compiler/rustc_hir_analysis/src/impl_wf_check.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/impl_wf_check.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/impl_wf_check.rs b/compiler/rustc_hir_analysis/src/impl_wf_check.rs
index a8ae620f7a4..ab441ed4cde 100644
--- a/compiler/rustc_hir_analysis/src/impl_wf_check.rs
+++ b/compiler/rustc_hir_analysis/src/impl_wf_check.rs
@@ -8,6 +8,8 @@
 //! specialization errors. These things can (and probably should) be
 //! fixed, but for the moment it's easier to do these checks early.
 
+use std::assert_matches::debug_assert_matches;
+
 use min_specialization::check_min_specialization;
 use rustc_data_structures::fx::FxHashSet;
 use rustc_errors::codes::*;
@@ -54,7 +56,7 @@ mod min_specialization;
 pub fn check_impl_wf(tcx: TyCtxt<'_>, impl_def_id: LocalDefId) -> Result<(), ErrorGuaranteed> {
     let min_specialization = tcx.features().min_specialization;
     let mut res = Ok(());
-    debug_assert!(matches!(tcx.def_kind(impl_def_id), DefKind::Impl { .. }));
+    debug_assert_matches!(tcx.def_kind(impl_def_id), DefKind::Impl { .. });
     res = res.and(enforce_impl_params_are_constrained(tcx, impl_def_id));
     if min_specialization {
         res = res.and(check_min_specialization(tcx, impl_def_id));