jameysharp requested fitzgen for a review on PR #5295.
jameysharp opened PR #5295 from isle-root-term
to main
:
In #5174 we decided it doesn't make sense for a rule to have a bind-pattern at the root of its left-hand side. There's no Rust value corresponding to the root value of such a term, because it actually represents a function declaration with one or more arguments.
This commit takes that to its logical conclusion.
sema::Rule
previously had anlhs
field whose value must always be aPattern::Term
variant, and anyone using that structure had to deal with the possibility of finding the wrong variant there.Now the relevant fields from that variant are stored directly in
Rule
instead. Also, the (tiny!) portion oftranslate_pattern
which applied when the pattern was the root term is now inlined incollect_rules
.Because
translate_pattern
no longer has to special-case the root term, we can delete itsrule_term
andis_root
arguments. That brings it down to a more manageable four arguments, which means many calls fit on one line now.
fitzgen submitted PR review.
jameysharp merged PR #5295.
Last updated: Dec 23 2024 at 13:07 UTC