Issue with column location
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
It looks like there's a slight bug with token locations in the following rust code (from #2376)
#![allow(unused)]
fn main() {
extern "C" { fn some_func<T>(x: T); }
}
<source>:3:13: error: foreign items may not have type parameters [E0044]
3 | extern "C" { fn some_func<T>(x: T); }
| ^~
We've had similar issues with location tracking before, and it might be worthwhile to adjust our lexer a bit to reduce the prevalence of these kinds of bugs
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 with the reduced Rust example and its diagnostic output, then inspect gccrs lexer token-location tracking and compare the related discussion in issue #2376. Reproduce the reported column mismatch and determine the expected location for the foreign-item type-parameter error; done means the diagnostic points to the appropriate source span and regression coverage is added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100