rust-lang / rust-lang/rust-analyzer

Wrong offset.

Open
#17,112 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: v0.3.1924-standalone

rustc version: (eg. output of 1.77.1)

editor or extension: VSCode

related file: https://github.com/raydium-io/raydium-contract-instructions/blob/master/lib/src/amm_stats.rs

image
(basic view of struct repr(C))
image
(Correct offset,but the next field's offset should be 0x128)
image
(Wrong)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report in lib/src/amm_stats.rs from the linked raydium-contract-instructions project using rust-analyzer v0.3.1924-standalone in VSCode. Compare the displayed offsets for the repr(C) struct with the screenshots; done when the next field's offset is reported as 0x128 rather than the shown wrong value.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.