rust-lang / rust-lang/fls

RFC 0463 Future-proof literal suffixes

Open Beginner friendly
#599 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
reStructuredText
Stars
497
Forks
41
Avg merge
3h 52m
Merged PRs (30d)
4

Description

RFC 0463 (rust-lang/rfcs#0463, which was before Rust 1.0) decided that at lexing time quoted literals and numeric literals can include arbitrary suffixes, not just those suffixes that are currently accepted in literal expressions.

The form of the suffix is the same as the form of an identifier-or-keyword. A lone underscore isn't allowed as the suffix for a quoted literal (for a numeric literal such an underscore would be allowed, but treated as part of the final sequence of digits not as a suffix).

The FLS currently describes the situation before that RFC, where the only suffixes allowed at lexing time were the type indicators.

That is, the FLS is incorrectly saying that a MacroInvocation like m!("abc"d) would be treated as seeing two tokens "abc" and d, when in fact there's only one.

(In 2021 when the FLS was written that Reference was in a similar state to the FLS, but it has been updated since.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the FLS rules for lexing quoted and numeric literals, then compare them with RFC 0463 and the updated Rust Reference. Update the FLS so arbitrary identifier-or-keyword suffixes are handled correctly, including the m!("abc"d) MacroInvocation example, and verify the resulting tokenization description.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.