You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
0.3.1426-standalone (2023-03-06)
0.3.1498-standalone (2023-05-01)
Several releases between those, when I did basic bisecting
rustc version: (eg. output of rustc -V)
rustc 1.69.0 (84c898d65 2023-04-16)
Also rustc 1.69.0-nightly (ef934d9b6 2023-02-08)
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
None
I normally use the rustup rust-analyzer, but I was excited to see const evaluation support in newer versions and wanted to try it out. I did cargo init --lib for a blank project and added the following consts:
The rust-analyzer info for the plain constant ANGLE_01 is correct:
const ANGLE_01: f64 = 180.0
The (MIR?) const evaluation is incorrect for ANGLE_02, which should just be 178.0:
const ANGLE_02: f64 = 1.0012832363282406e-306
If I change it to an f32, it's similarly wrong:
const ANGLE_02: f32 = 5.2897246e-37
I'd expect these to show 178.0, or close enough for a float. Am I misunderstanding the purpose of the const evaluation support, or am I doing something dumb?
The text was updated successfully, but these errors were encountered:
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rustc version: (eg. output of
rustc -V
)relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTC
,RUSTUP_HOME
orCARGO_HOME
)I normally use the rustup rust-analyzer, but I was excited to see const evaluation support in newer versions and wanted to try it out. I did
cargo init --lib
for a blank project and added the following consts:The rust-analyzer info for the plain constant ANGLE_01 is correct:
The (MIR?) const evaluation is incorrect for ANGLE_02, which should just be 178.0:
If I change it to an f32, it's similarly wrong:
I'd expect these to show 178.0, or close enough for a float. Am I misunderstanding the purpose of the const evaluation support, or am I doing something dumb?
The text was updated successfully, but these errors were encountered: