panic location counts tabs as four columns instead of one
Open
Nobody has claimed this yet.
A-debuginfo
A-panic
C-bug
needs-triage
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code (note that indentation is in tabs, not spaces):
fn main() {
panic!();
}
I expected to see this happen:
thread 'main' panicked at src/main.rs:2:2:
explicit panic
Instead, this happened:
thread 'main' panicked at src/main.rs:2:5:
explicit panic
Meta
rustc --version --verbose:
rustc 1.90.0 (1159e78c4 2025-09-14)
binary: rustc
commit-hash: 1159e78c4747b02ef996e55082b704c09b970588
commit-date: 2025-09-14
host: x86_64-unknown-linux-gnu
release: 1.90.0
LLVM version: 20.1.8
Backtrace
<backtrace>
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 reproducing the snippet in src/main.rs with the reported rustc version and compare the panic location for tab indentation. Trace the compiler's panic location reporting to determine where the column is calculated; done means the example reports src/main.rs:2:2 rather than src/main.rs:2:5.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100