Skip to content

bug: Hover hint for a byte const reports 0 rather than its value #12137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
budde25 opened this issue May 2, 2022 · 0 comments · Fixed by #12157
Closed

bug: Hover hint for a byte const reports 0 rather than its value #12137

budde25 opened this issue May 2, 2022 · 0 comments · Fixed by #12157
Assignees

Comments

@budde25
Copy link

budde25 commented May 2, 2022

The following code has two u8 consts

fn main() {
    const A: u8 = 10;
    const B: u8 = b'B';
    dbg!("{}:{}", A, B);
}

The output is as follows:

[src/main.rs:4] "{}:{}" = "{}:{}"
[src/main.rs:4] A = 10
[src/main.rs:4] B = 66

However when I hover only the A shows me the value:
image
here B does not:
image
I would expect B's hover hint to show const B: u8 = 66 (0x42) rather than const B: u8 = 0

rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)
rust-analyzer version: 5dce1ff 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants