RFC2229 Add missing edge case - #87996
Conversation
|
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
| } | ||
| } else { | ||
| // If it is not ty::Adt, then it should be read | ||
| needs_to_be_read = true; |
There was a problem hiding this comment.
I am wondering what cases might be missing here -- one silly example might be matching on a constant of type () or something like that, which is kind of a no-op.
There was a problem hiding this comment.
I am not too sure either. I am going to import all the match test cases that are here https://github.com/rust-lang/rust/tree/master/src/test/ui/match and then convert them into closure test cases and see if I found anything new
|
@bors r+ We might as well land this PR in the meantime. |
|
📌 Commit 2e61659 has been approved by |
RFC2229 Add missing edge case Closes rust-lang#87988 This PR fixes an ICE where a match discriminant is not being read when expected. This ICE was the result of a missing edge case which assumed that if a pattern is of type `PatKind::TupleStruct(..) | PatKind::Path(..) | PatKind::Struct(..) | PatKind::Tuple(..)` then a place could only be a multi variant if the place is of type kind Adt.
|
☀️ Test successful - checks-actions |
Closes #87988
This PR fixes an ICE where a match discriminant is not being read when expected. This ICE was the result of a missing edge case which assumed that if a pattern is of type
PatKind::TupleStruct(..) | PatKind::Path(..) | PatKind::Struct(..) | PatKind::Tuple(..)then a place could only be a multi variant if the place is of type kind Adt.