81% of diagnostics point at 0:0, so the span in the message locates nothing
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 14
- Forks
- 2
- Avg merge
- 13h 13m
- Merged PRs (30d)
- 70
Description
Across the fail-tier corpus:
diagnostics carrying a rendered span: 113
of those at 0:0: 91
81% of the spans a user is shown point at line 0, column 0 — a position no source file has. The diagnostic machinery is fine; the spans reaching it are Span::default().
Where they come from
Two distinct sources, worth separating before anyone starts:
- Literals are constructed span-less.
NumberExpris built withSpan::default()at the parser's number sites (src/parser/expr.rs:892, :897), so any rule reporting against a literal has nothing to point at. This is what makes E3019 (matcharm literal out of range) name the literal in its text but locate it at 0:0 — the text is doing the work the span should. - Call sites carry no span. E6001 (
requires topology '…', but is called from '…') renders 0:0 even thoughFunctionCallExprhas aspanfield, so somewhere between parse and report it is default.
There is also a third class that does not reach the span machinery at all: several errors are pushed as bare strings with no code and no span (Error: Cross-topology access error: …), which renders with no position at all rather than a wrong one.
Why it matters for a release
A span that says 0:0 is worse than no span: an IDE or an LSP client will happily jump the cursor to the top of the file. It also defeats the fix-it hints, which carry the same span — the W1001 "prefix with underscore" suggestion currently proposes an edit at 0:0.
Suggested order
The parser fix is the broad one and probably reclaims most of the 91. Worth measuring the same two numbers after it, since the remainder will point at whichever rules synthesize expressions rather than reading them from source.
Found while fixing Vx#334 / Vx#431. Related: Vx#448 (the same messages print internal Debug output).
Contributor guide
No contributing guide indexed for this repository
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 in src/parser/expr.rs at the NumberExpr construction sites around lines 892 and 897, then trace FunctionCallExpr spans through diagnostic reporting for E3019 and E6001. Compare the fail-tier corpus counts before and after the changes, and inspect the bare-string errors separately. Done means diagnostics and related fix-it hints no longer use 0:0 when a source span is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100