Merge pull request #18620 from Veykril/push-pyulxnouvxkq

fix: Parse lifetime bounds in lifetime param into TypeBoundList
This commit is contained in:
Lukas Wirth 2024-12-05 17:06:02 +00:00 committed by GitHub
commit 7f39ee3fce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 125 additions and 85 deletions

View file

@ -1630,6 +1630,29 @@ fn test<'lifetime>(
);
}
#[test]
fn lifetime_bounds() {
check_infer(
r#"
//- minicore: sized, coerce_unsized
trait Trait<'a>: Sized {
fn f(&'a self) {}
}
fn test<'a, 'b: 'a>(it: impl Trait<'a>){
it.f();
}
"#,
expect![[r#"
38..42 'self': &'a Self
44..46 '{}': ()
69..71 'it': impl Trait<'a>
88..103 '{ it.f(); }': ()
94..96 'it': impl Trait<'a>
94..100 'it.f()': ()
"#]],
);
}
#[test]
fn error_bound_chalk() {
check_types(