Rustfmt eating the colon in bound-less where clause entries (for lifetimes).
Open
Nobody has claimed this yet.
C-bug
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
pub fn foo<'a>()
where
'a: ,
{
}
becomes
pub fn foo<'a>()
where
'a,
{
}
resulting in syntax error.
This kind of code can actually be usefult to turn 'a into an early bound lifetime.
Tested in the rustfmt shipped with nightly rust (rustfmt 1.4.30-nightly (acd9486 2020-12-20)).
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.
Research direction
Start by running rustfmt on the minimal Rust example in the issue and inspect the formatting path for where-clause lifetime bounds. Add a regression test using the shown input; done means formatting preserves the colon in 'a: , and the result remains valid Rust.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100