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:
commit
7c6dca9050
39 changed files with 100 additions and 49 deletions
|
@ -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 {
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue