Support floating point intrinsics in const eval

This commit is contained in:
hkalbasi 2023-06-02 17:29:17 +03:30
parent f9e3b180b7
commit a6a27a7ff8
4 changed files with 296 additions and 109 deletions

View file

@ -4337,6 +4337,30 @@ const FOO$0: f64 = 1.0f64;
);
}
#[test]
fn hover_const_eval_floating_point() {
check(
r#"
extern "rust-intrinsic" {
pub fn expf64(x: f64) -> f64;
}
const FOO$0: f64 = expf64(1.2);
"#,
expect![[r#"
*FOO*
```rust
test
```
```rust
const FOO: f64 = 3.3201169227365472
```
"#]],
);
}
#[test]
fn hover_const_eval_enum() {
check(