Skip to content

Commit

Permalink
Fix struct pattern irrefutability to require the deconstructee to be …
Browse files Browse the repository at this point in the history
…a struct or union
  • Loading branch information
Veykril committed Nov 16, 2023
1 parent 496ef38 commit 916d467
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/patterns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,19 @@ A :t:`struct pattern` is interpreted based on the :t:`deconstructee`. It is a
static error if a :t:`struct pattern` cannot be interpreted.

:dp:`fls_r8rat3qmc4hy`
A :t:`struct pattern` is an :t:`irrefutable pattern` when all of its
:t:`[subpattern]s` are :t:`[irrefutable pattern]s`.
A :t:`struct pattern` is an :t:`irrefutable pattern` if

* :dp:`fls_hUX723DmLg2a`
All of its :t:`[subpattern]s` are :t:`[irrefutable pattern]s`, and

* :dp:`fls_p4OplpUvS04l`
The :t:`deconstructree` is either:

* :dp:`fls_pre3YwAv01FE`
A :t:`struct type` or a :t:`union type`, or

* :dp:`fls_MK83WE0iDqNf`
An :t:`enum variant` of an :t:`enum` with a single :t:`enum variant`.

.. _fls_nruvg0es3kx7:

Expand Down

0 comments on commit 916d467

Please sign in to comment.