Distinguish Rust character literals from lifetimes in the spacing helper
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with tools/format-rust.py, especially add_function_spacing and its lexical-state handling. Add focused Python tests for the reproduction, lifetimes, escaped quotes, and byte-character literals; verify that function boundaries are found, literal contents stay unchanged, and repeated runs are idempotent.
Written by the indexing model from the issue text.
Description
Problem
An alphabetic char literal such as 'a' is treated as a lifetime prefix. Its closing quote opens char state, so function boundaries later in the file disappear.
Reproduction
Executed the helper at fd07427f4a976de05e38eff3ee1760db97fbb761 using importlib and add_function_spacing on:
fn first() {
let c = 'a';
}
fn second() {}
The result is unchanged; the intended separating blank line is missing. Starting point: tools/format-rust.py.
Scope
Fix lexical state for character/escaped/byte-character literals while preserving lifetimes. Keep literal contents unchanged. Difficulty: easy.
Completion criteria
- Find function boundaries after char literals.
- Cover lifetimes, escaped quotes and byte chars.
- Keep the helper idempotent with focused Python tests.
- Dominant language
- Rust
- Stars
- 56
- Forks
- 21
- Avg merge
- 4h 58m
- Merged PRs (30d)
- 54
Getting set up
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 wavefnd/Wave
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
good first issue performance
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
enhancement good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
chipsalliance/caliptra-sw#4311 ·
Maintainers usually reply within 2 days
-
`image_generation`: `max_retries` is ignored for OpenAI-compatible providers (always 2 retries)Possibly taken @ericz7900 claimed this today. Openllm translation
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Help-Wanted Needs-Triage Package-Request
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
microsoft/winget-pkgs#456324 ·
Maintainers usually reply within 1 day
-
ai_p2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ClickHouse/ClickHouse#126833 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day