Use assert_matches around the compiler
This commit is contained in:
@@ -10,6 +10,7 @@ mod path;
|
||||
mod stmt;
|
||||
mod ty;
|
||||
|
||||
use std::assert_matches::debug_assert_matches;
|
||||
use std::ops::Range;
|
||||
use std::{fmt, mem, slice};
|
||||
|
||||
@@ -1385,7 +1386,7 @@ impl<'a> Parser<'a> {
|
||||
// can capture these tokens if necessary.
|
||||
self.bump();
|
||||
if self.token_cursor.stack.len() == target_depth {
|
||||
debug_assert!(matches!(self.token.kind, token::CloseDelim(_)));
|
||||
debug_assert_matches!(self.token.kind, token::CloseDelim(_));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use std::assert_matches::assert_matches;
|
||||
use std::io::prelude::*;
|
||||
use std::iter::Peekable;
|
||||
use std::path::{Path, PathBuf};
|
||||
@@ -1747,7 +1748,7 @@ fn out_of_line_mod() {
|
||||
.unwrap();
|
||||
|
||||
let ast::ItemKind::Mod(_, mod_kind) = &item.kind else { panic!() };
|
||||
assert!(matches!(mod_kind, ast::ModKind::Loaded(items, ..) if items.len() == 2));
|
||||
assert_matches!(mod_kind, ast::ModKind::Loaded(items, ..) if items.len() == 2);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user