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
39 changed files with 100 additions and 49 deletions

View File

@@ -1,3 +1,4 @@
use std::assert_matches::assert_matches;
use std::fmt;
use arrayvec::ArrayVec;
@@ -389,7 +390,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
}
// Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]);
(OperandValue::Immediate(llval), Abi::Aggregate { sized: true }) => {
assert!(matches!(self.layout.abi, Abi::Vector { .. }));
assert_matches!(self.layout.abi, Abi::Vector { .. });
let llfield_ty = bx.cx().backend_type(field);