Skip to content

Hovering over constant using slice shows incorrect value #20868

@zeng-y-l

Description

@zeng-y-l

rust-analyzer version: 0.3.2593-standalone (6b2e677 2025-08-25)

rustc version: rustc 1.88.0 (6b00bc388 2025-06-23)

editor or extension: VSCode 1.105.0, rust-analyzer 0.3.2593

code snippet to reproduce:

const DATA: &[&[u64]] = &[&[42]];

// 0x1000000000000060
const A: u64 = {
    123u64 < 234; // comment out this or the next line, A will be 0
    345u64 < 456;
    let x = DATA[0][0]; // inline x, A will be 456
    x
};

Hover over A (expect 42):

Image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions