rust-lang / rust-lang/rust-analyzer
Show size for types with generics in them
Open
Nobody has claimed this yet.
C-feature
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
struct S<T> {
data: [u8; 1024],
t: T,
}
hover doesn't show the size. I would like something like
// size = 1024 (0x400) + size of T
The size is completely turned off when a generic exists so
struct S<T> {
data: [u8; 1024],
t: PhantomData<T>,
}
or
struct S<T = SomeEnum> {
data: [u8; 1024],
t: T,
}
Don't work even if they should.
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 hover output for the three generic struct examples in the issue, then read the related rust-analyzer issue 16634 for context. Trace the hover size calculation and its handling of generic types; done means the applicable examples display useful size information instead of omitting it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100