fix: Panic while rendering function with impl trait arg

This commit is contained in:
Shoyu Vanilla 2024-08-08 22:03:31 +09:00
parent 34d9409211
commit aa62c9d664
2 changed files with 27 additions and 4 deletions

View file

@ -8579,3 +8579,26 @@ fn main(a$0: T) {}
"#]],
);
}
#[test]
fn hover_fn_with_impl_trait_arg() {
check(
r#"
trait Foo {}
impl Foo for bool {}
fn bar<const WIDTH: u8>(_: impl Foo) {}
fn test() {
let f = bar::<3>;
f$0(true);
}
"#,
expect![[r#"
*f*
```rust
// size = 0, align = 1
let f: fn bar<3>(bool)
```
"#]],
);
}