mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Merge pull request #18620 from Veykril/push-pyulxnouvxkq
fix: Parse lifetime bounds in lifetime param into TypeBoundList
This commit is contained in:
commit
7f39ee3fce
14 changed files with 125 additions and 85 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue