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::Rulepreviously had anlhsfield whose value must always be aPattern::Termvariant, 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
Ruleinstead. Also, the (tiny!) portion oftranslate_patternwhich applied when the pattern was the root term is now inlined incollect_rules.Because
translate_patternno longer has to special-case the root term, we can delete itsrule_termandis_rootarguments. 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 13 2025 at 19:03 UTC