Rollup merge of #128978 - compiler-errors:assert-matches, r=jieyouxu

Use `assert_matches` around the compiler more

It's a useful assertion, especially since it actually prints out the LHS.
This commit is contained in:
Guillaume Gomez 2024-08-12 17:09:19 +02:00 committed by GitHub
commit 7c6dca9050
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 100 additions and 49 deletions

View file

@ -8,6 +8,7 @@
//! Typical examples would include: minimum element in SCC, maximum element
//! reachable from it, etc.
use std::assert_matches::debug_assert_matches;
use std::fmt::Debug;
use std::ops::Range;
@ -569,7 +570,7 @@ where
// This None marks that we still have the initialize this node's frame.
debug!(?depth, ?node);
debug_assert!(matches!(self.node_states[node], NodeState::NotVisited));
debug_assert_matches!(self.node_states[node], NodeState::NotVisited);
// Push `node` onto the stack.
self.node_states[node] = NodeState::BeingVisited {

View file

@ -18,6 +18,7 @@
#![feature(array_windows)]
#![feature(ascii_char)]
#![feature(ascii_char_variants)]
#![feature(assert_matches)]
#![feature(auto_traits)]
#![feature(cfg_match)]
#![feature(core_intrinsics)]