about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbitgaoshu <bitgaoshu@gmail.com>2022-06-26 23:09:06 +0800
committerbitgaoshu <bitgaoshu@gmail.com>2022-06-26 23:09:06 +0800
commitdcb4837b2d07aeac2126dc6312a7a48992d11b85 (patch)
treea8c46856e0edcdf4ca60813a29747298bc6f28d1
parent408fa148b9690387316115af33d80c997128b2c5 (diff)
downloadrust-dcb4837b2d07aeac2126dc6312a7a48992d11b85.tar.gz
rust-dcb4837b2d07aeac2126dc6312a7a48992d11b85.zip
WellFormed -> Holds
-rw-r--r--crates/hir-ty/src/method_resolution.rs2
-rw-r--r--crates/ide/src/goto_definition.rs26
2 files changed, 27 insertions, 1 deletions
diff --git a/crates/hir-ty/src/method_resolution.rs b/crates/hir-ty/src/method_resolution.rs
index 76c76ee6cf4..d2081d22d79 100644
--- a/crates/hir-ty/src/method_resolution.rs
+++ b/crates/hir-ty/src/method_resolution.rs
@@ -615,7 +615,7 @@ fn find_matching_impl(
                     let wh_goals =
                         crate::chalk_db::convert_where_clauses(db, impl_.into(), &substs)
                             .into_iter()
-                            .map(|b| b.into_well_formed_goal(Interner).cast(Interner));
+                            .map(|b| b.cast(Interner));
 
                     let goal = crate::Goal::all(Interner, wh_goals);
 
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs
index fb88d1ec842..e10789fd47a 100644
--- a/crates/ide/src/goto_definition.rs
+++ b/crates/ide/src/goto_definition.rs
@@ -1445,6 +1445,32 @@ fn f() {
                 "#,
             );
         }
+        #[test]
+        fn wc_case_is_ok() {
+            check(
+                r#"
+trait G {
+    fn g(&self);
+}
+trait BParent{}
+trait Bound: BParent{}
+struct Gen<T>(T);
+impl <T> G for Gen<T>
+where T : Bound
+{
+    fn g(&self){
+     //^
+    }
+}
+struct A;
+impl Bound for A{}
+fn f() {
+    let gen = Gen::<A>(A);
+    gen.g$0();
+}
+"#,
+            );
+        }
 
         #[test]
         fn method_call_defaulted() {