mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 07:37:30 +00:00
Higher-ranked trait bounds for where clauses
This commit is contained in:
parent
c8c58d81ec
commit
fa65d6ba85
4 changed files with 74 additions and 18 deletions
|
@ -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)>, {}
|
||||
//^^
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue