Ensure all precedence rules are covered.
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- documentation
Research direction
Start by comparing expressions.md and patterns.md with the precedence behavior described in RFC 16 and the linked issues 55851 and 34511. Use the grammar as a possible completeness check, then identify and document the missing attribute, closure, impl-in-type, and other type-expression rules. Done means the reference clearly covers all precedence cases found.
Written by the indexing model from the issue text.
Description
I think there are various bits of precedence rules that are not covered in the reference. expressions.md covers most of them, and patterns.md has one precedence rule noted.
I'm not sure what is missing, some that I can think of:
Attribute precedence. #[attr] x = 1; the attribute (I think) goes to the place expression, not the statement. RFC 16 says "Attributes bind tighter than any operator".
I think the way let _ = ||{}(); fails to parse isn't clear to me. The precedence rules just say "closures", but doesn't specify what that encompasses. See https://github.com/rust-lang/rust/issues/55851.
impl precedence in types. This is briefly mentioned in https://github.com/rust-lang/rust/issues/34511. I think there are other various precedence rules in type expressions.
I feel like there are various other precedence rules that are missing, but I can't think of any others right now. Perhaps at some point the gll grammar could inform all the rules?
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/reference
-
A-const-eval A-undefined-behavior
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
A-resolve
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
A-coercions
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
All issues in rust-lang/reference
Similar issues
-
type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
registrystack/registry-stack#1239 ·
-
risk:low runtime status:in-progress type:test
Difficulty 1/5 Under an hour Newbie friendliness 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
EricSpencer00/Resilient#4835 · 1 comment ·