diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index ea7fd3e0728..c3afe14fa3d 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs @@ -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(s: T) { + s.a$0(); +} + "#, + ); + } } #[test]