An nbsp isn’t treated as whitespace but instead throws an error
Open
Nobody has claimed this yet.
A-parser
D-papercut
D-verbose
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
let [insert nbsp] a = 10;
I expected to see this happen: The nbsp is treated as a normal whitespace character.
Instead, this happened: Multiple errors are thrown:
Unicode character ' ' (No-Break Space) looks like ' ' (Space), but it is not: ` ` (rustc)
Syntax Error: expected expression, item or let statement (rust-analyzer)
unknown start of token: \u{a0} (rustc)
Meta
rustc --version --verbose:
rustc 1.74.0 (79e9716c9 2023-11-13)
binary: rustc
commit-hash: 79e9716c980570bfd1f666e3b16ac583f0168962
commit-date: 2023-11-13
host: aarch64-apple-darwin
release: 1.74.0
LLVM version: 17.0.4
If this is intentional, why are you doing it? What are the benefits?
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
Begin by reproducing the provided Rust example and comparing the rustc and rust-analyzer diagnostics. Done means reaching an agreed behavior for a no-break space in source whitespace and confirming the example no longer produces the reported errors.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100