mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Auto merge of #14950 - HKalbasi:render-const, r=HKalbasi
Support floating point intrinsics in const eval
This commit is contained in:
commit
dfaca9398a
4 changed files with 296 additions and 109 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue