Higher-ranked trait bounds for where clauses

This commit is contained in:
Lukas Wirth 2020-12-17 22:01:42 +01:00
parent c8c58d81ec
commit fa65d6ba85
4 changed files with 74 additions and 18 deletions

View 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)>, {}
//^^
"#,
);
}
}