You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#115893 - RalfJung:match-require-partial-eq, r=oli-obk
lint towards rejecting consts in patterns that do not implement PartialEq
I think we definitely don't want to allow such consts, so even while the general plan around structural matching is up in the air, we can start the process of getting non-PartialEq matches out of the ecosystem.
Copy file name to clipboardexpand all lines: compiler/rustc_mir_build/messages.ftl
+3
Original file line number
Diff line number
Diff line change
@@ -229,6 +229,9 @@ mir_build_non_exhaustive_patterns_type_not_empty = non-exhaustive patterns: type
229
229
.suggestion = ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
230
230
.help = ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
231
231
232
+
mir_build_non_partial_eq_match =
233
+
to use a constant of type `{$non_peq_ty}` in a pattern, the type must implement `PartialEq`
234
+
232
235
mir_build_nontrivial_structural_match =
233
236
to use a constant of type `{$non_sm_ty}` in a pattern, the constant's initializer must be trivial or `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]`
0 commit comments