From 4a6cdd776d403bacce0a5471d77e8c76695c5bc5 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 May 2021 16:59:23 +0200 Subject: Record method call substs and use them in call info --- crates/ide_db/src/call_info/tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'crates/ide_db') diff --git a/crates/ide_db/src/call_info/tests.rs b/crates/ide_db/src/call_info/tests.rs index be1cc12de..1aeda08e5 100644 --- a/crates/ide_db/src/call_info/tests.rs +++ b/crates/ide_db/src/call_info/tests.rs @@ -188,6 +188,24 @@ fn main() { S.foo($0); } ); } +#[test] +fn test_fn_signature_for_generic_method() { + check( + r#" +struct S(T); +impl S { + fn foo(&self, x: T) {} +} + +fn main() { S(1u32).foo($0); } +"#, + expect![[r#" + fn foo(&self, x: u32) + () + "#]], + ); +} + #[test] fn test_fn_signature_for_method_with_arg_as_assoc_fn() { check( -- cgit v1.2.3