From f7096db910620d33bb70dc31ddab69d12c0ce96e Mon Sep 17 00:00:00 2001 From: 1hakusai1 <1hakusai1@gmail.com> Date: Mon, 20 Jan 2025 21:22:58 +0900 Subject: [PATCH] Add a test case --- .../crates/ide/src/goto_definition.rs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs b/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs index 905376e75570..f804cc367727 100644 --- a/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs +++ b/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs @@ -3062,6 +3062,30 @@ fn f() { ); } + #[test] + fn into_call_to_from_definition_with_trait_bounds() { + check( + r#" +//- minicore: from, iterator +struct A; + +impl From for A +where + T: IntoIterator, +{ + fn from(value: T) -> Self { + //^^^^ + A + } +} + +fn f() { + let a: A = [1, 2, 3].into$0(); +} + "#, + ); + } + #[test] fn goto_into_definition_if_exists() { check(