Skip to content

Commit

Permalink
mention associated consts
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung authored May 3, 2024
1 parent 3fb728d commit c6719b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ Furthermore we require that the value of `C` *has (recursive) structural equalit
- Nothing else has structural equality.

In particular, the value of `C` must be known at pattern-building time (which is pre-monomorphization).
This means that associated consts cannot be used as patterns.

After ensuring all conditions are met, the constant value is translated into a pattern, and now behaves exactly as-if that pattern had been written directly.
In particular, it fully participates in exhaustiveness checking.
Expand Down

0 comments on commit c6719b5

Please sign in to comment.