Auto merge of #14950 - HKalbasi:render-const, r=HKalbasi

Support floating point intrinsics in const eval
This commit is contained in:
bors 2023-06-02 13:59:47 +00:00
commit dfaca9398a
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(