1
Fork 0

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

@ -1,3 +1,5 @@
use std::assert_matches::assert_matches;
use super::*;
#[allow(non_snake_case)]
@ -16,7 +18,7 @@ fn lookup_cdecl() {
#[test]
fn lookup_baz() {
let abi = lookup("baz");
assert!(matches!(abi, Err(AbiUnsupported::Unrecognized)))
assert_matches!(abi, Err(AbiUnsupported::Unrecognized));
}
#[test]