From fa65d6ba855fb2da68840b987bfdec258239a59b Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 17 Dec 2020 22:01:42 +0100 Subject: Higher-ranked trait bounds for where clauses --- crates/ide/src/goto_definition.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'crates/ide') diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index 173509b08..d75ae447b 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs @@ -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 {} +fn foo() where for<'a> T: Foo<&'a<|> (u8, u16)>, {} + //^^ +"#, + ); + check( + r#"trait Foo {} +fn foo() 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 {} +fn foo() where T: for<'a> Foo<&'a<|> (u8, u16)>, {} + //^^ +"#, + ); + } } -- cgit v1.2.3