error[internal]: left behind trailing whitespace
Open
Nobody has claimed this yet.
A-rustfmt::skip
C-bug
I-trailing-whitespace
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
this code:
mod phase {
pub trait Phase {
const RUN: &'static str;
const FAIL: &'static str;
fn to_style(&self, template: &str);
}
pub struct Updating {}
impl Phase for Updating {
const RUN: &'static str = "";
const FAIL: &'static str = "";
#[rustfmt::skip]
fn to_style(&self, template: &str) {}
}
}
fn main() {}
produces this error:
error[internal]: left behind trailing whitespace
--> /tmp/arif/src/main.rs:14:14:1
|
14 |
| ^^^^^^^^^^^^
|
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 the Rust code reproducer from the issue and inspect how rustfmt handles the #[rustfmt::skip] function and the whitespace in /tmp/arif/src/main.rs. Trace the path that reports “left behind trailing whitespace”; done means the reproducer no longer produces this internal error while preserving the intended formatting behavior.
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
- 45/100