Skip to content

Commit

Permalink
Merge #469
Browse files Browse the repository at this point in the history
469: Fix struct pattern irrefutability to require the deconstructee to be a struct or union or single variant enum r=pietroalbini a=Veykril

Fixes #455

Co-authored-by: Lukas Wirth <[email protected]>
  • Loading branch information
bors-ferrocene[bot] and Veykril authored Nov 16, 2023
2 parents af77e1e + 916d467 commit d07f310
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 d07f310

Please sign in to comment.