mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Add two more tests
This commit is contained in:
parent
29f01cd9d2
commit
f410fdf6e3
@ -1429,6 +1429,43 @@ fn f() {
|
|||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn method_call_defaulted() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
trait Twait {
|
||||||
|
fn a(&self) {}
|
||||||
|
//^
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Stwuct;
|
||||||
|
|
||||||
|
impl Twait for Stwuct {
|
||||||
|
}
|
||||||
|
fn f() {
|
||||||
|
let s = Stwuct;
|
||||||
|
s.a$0();
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn method_call_on_generic() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
trait Twait {
|
||||||
|
fn a(&self) {}
|
||||||
|
//^
|
||||||
|
}
|
||||||
|
|
||||||
|
fn f<T: Twait>(s: T) {
|
||||||
|
s.a$0();
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user