mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
feat: Handle operators like their trait functions in the IDE
This commit is contained in:
parent
cb52271701
commit
d6e78b04d0
12 changed files with 459 additions and 68 deletions
|
@ -5051,3 +5051,37 @@ fn f() {
|
|||
```"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_deref() {
|
||||
check(
|
||||
r#"
|
||||
//- minicore: deref
|
||||
|
||||
struct Struct(usize);
|
||||
|
||||
impl core::ops::Deref for Struct {
|
||||
type Target = usize;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
fn f() {
|
||||
$0*Struct(0);
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
***
|
||||
|
||||
```rust
|
||||
test::Struct
|
||||
```
|
||||
|
||||
```rust
|
||||
fn deref(&self) -> &Self::Target
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue