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
Copy file name to clipboardExpand all lines: patterns.md
+1
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ fn is_foo(x: i32) -> bool {
14
14
However, that check has some loopholes, so e.g. `&T` can be used in a pattern no matter the `T`.
15
15
16
16
Any reference type const-pattern is compiled by [calling `PartialEq::eq`][compile-partial-eq] to compare the subject of the `match` with the constant. Const-patterns with other types (enum, struct, tuple, array) are treated as if the constant was inlined as a pattern (and the usual `match` tree is constructed).
17
+
Note that this is in contradiction with what has been RFC'd, which specifies that we should always call `PartialEq::eq`.
0 commit comments