Repository navigation
Merged
Conversation
…forms (#2744, D163) The compiler has always required `=>` after an arm's pattern and taken the body inline, indented, or braced, but the spec showed that only by example — and two sentences said the opposite: §29.13 required `:` or `{` after every construct's header, and §30.8 listed match arms among those constructs, so a literal reader writes `Some(x):` and gets "expected '=>'". §30.4 allowed only an expression after `=>`. §9.7 now states the arm rule; §29.13 excepts match arms from the `:`/`{` introducer rule (their introducer is `=>`); §30.4 takes an `ARM_BODY` (expression, indented block, or braced block); §30.8 drops match arms from the colon constructs. No compiler behavior changes. Evidence on main dee141b with `with v0.15.3.0`: all three arm body forms run (1/2/3), and `Some(v):` is refused with "expected '=>'" — pinned by behav_2744_match_arm_three_body_forms and err_2744_match_arm_colon_body (both pass pre-change; they pin the behavior the words now state). :spec-inventory-check green. Delegated under D98 as D163 (90%: the rule content is the confirmed compiler behavior from #2744; not C interop, ownership or safety; a revert is one commit). Eric vetoes by revert or rewords.
pattern [if guard] => body, in the three body forms (#2744, D163)
Contributor
Author
|
Battery GREEN on the stack top |
ehartford
marked this pull request as ready for review
October 27, 2026 02:02
This was referenced Oct 27, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec: a match arm is
pattern [if guard] => body, in the three body forms (#2744, D163)The compiler has always required
=>after an arm's pattern and takenthe body inline, indented, or braced, but the spec showed that only by
example — and two sentences said the opposite: §29.13 required
:or{after every construct's header, and §30.8 listed match arms amongthose constructs, so a literal reader writes
Some(x):and gets"expected '=>'". §30.4 allowed only an expression after
=>.§9.7 now states the arm rule; §29.13 excepts match arms from the
:/{introducer rule (their introducer is=>); §30.4 takes anARM_BODY(expression, indented block, or braced block); §30.8 dropsmatch arms from the colon constructs. No compiler behavior changes.
Evidence on main dee141b with
with v0.15.3.0: all three arm bodyforms run (1/2/3), and
Some(v):is refused with "expected '=>'" —pinned by behav_2744_match_arm_three_body_forms and
err_2744_match_arm_colon_body (both pass pre-change; they pin the
behavior the words now state). :spec-inventory-check green.
Delegated under D98 as D163 (90%: the rule content is the confirmed
compiler behavior from #2744; not C interop, ownership or safety; a
revert is one commit). Eric vetoes by revert or rewords.