rust-lang / rust-lang/rust-analyzer
Bug: Inlay hint type annotation for includes_bytes! macro displays size 0 rather than the correct size
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
The type hint for a variable that is the result of the include_bytes! macro shows size zero rather than its correct size (which is known at compile time)
However after typing the exact hint in as it is presented, RA shows an error indicating a type mismatch on the size of the array.
I would expect the hint to display : &[u8; 122880].
rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)
rust-analyzer version: 5dce1ff02 2022-05-02 stable
rustc version: (eg. output of rustc -V)
rustc 1.60.0 (7737e0b5c 2022-04-04)
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME)
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
Reproduce the issue with a Rust variable initialized by the include_bytes! macro and compare the inlay hint with the compiler's array length. Trace the inlay-hint and type-inference path for this macro; done means the hint shows the correct byte-array size and no longer suggests a mismatched type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100