]> git.lizzy.rs Git - rust.git/blobdiff - crates/ide/src/goto_definition.rs
Merge #6921
[rust.git] / crates / ide / src / goto_definition.rs
index 7a12e99652f6a0f4d4eaf572f5dae027701b259f..431da5d9c75197126314fcd48d2f38fa956a9974 100644 (file)
@@ -1077,4 +1077,32 @@ fn foo<'foobar>(_: &'foobar<|> ()) {}
 }"#,
         )
     }
+
+    #[test]
+    #[ignore] // requires the HIR to somehow track these hrtb lifetimes
+    fn goto_lifetime_hrtb() {
+        check(
+            r#"trait Foo<T> {}
+fn foo<T>() where for<'a> T: Foo<&'a<|> (u8, u16)>, {}
+                    //^^
+"#,
+        );
+        check(
+            r#"trait Foo<T> {}
+fn foo<T>() where for<'a<|>> T: Foo<&'a (u8, u16)>, {}
+                    //^^
+"#,
+        );
+    }
+
+    #[test]
+    #[ignore] // requires ForTypes to be implemented
+    fn goto_lifetime_hrtb_for_type() {
+        check(
+            r#"trait Foo<T> {}
+fn foo<T>() where T: for<'a> Foo<&'a<|> (u8, u16)>, {}
+                       //^^
+"#,
+        );
+    }
 }