1
Fork 0

make non-PartialEq-typed consts as patterns a hard error

This commit is contained in:
Ralf Jung 2024-02-08 20:08:19 +01:00
parent e9f9594913
commit 5b7786cd1d
8 changed files with 27 additions and 112 deletions

View file

@ -767,6 +767,14 @@ pub struct TypeNotStructural<'tcx> {
pub non_sm_ty: Ty<'tcx>,
}
#[derive(Diagnostic)]
#[diag(mir_build_non_partial_eq_match)]
pub struct TypeNotPartialEq<'tcx> {
#[primary_span]
pub span: Span,
pub non_peq_ty: Ty<'tcx>,
}
#[derive(Diagnostic)]
#[diag(mir_build_invalid_pattern)]
pub struct InvalidPattern<'tcx> {
@ -822,12 +830,6 @@ pub struct NontrivialStructuralMatch<'tcx> {
pub non_sm_ty: Ty<'tcx>,
}
#[derive(LintDiagnostic)]
#[diag(mir_build_non_partial_eq_match)]
pub struct NonPartialEqMatch<'tcx> {
pub non_peq_ty: Ty<'tcx>,
}
#[derive(Diagnostic)]
#[diag(mir_build_pattern_not_covered, code = E0005)]
pub(crate) struct PatternNotCovered<'s, 'tcx> {