mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
feat: treat fn keyword inside function pointer type as primitive
This commit is contained in:
parent
9f1a3ae5ab
commit
67cc6c1e16
2 changed files with 33 additions and 3 deletions
|
@ -3382,6 +3382,30 @@ mod return_keyword {}
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_keyword_as_primitive() {
|
||||
check(
|
||||
r#"
|
||||
//- /main.rs crate:main deps:std
|
||||
type F = f$0n(i32) -> i32;
|
||||
//- /libstd.rs crate:std
|
||||
/// Docs for prim_fn
|
||||
mod prim_fn {}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*fn*
|
||||
|
||||
```rust
|
||||
fn
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Docs for prim_fn
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_builtin() {
|
||||
check(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue