Currently if you have multiple lifetimes with restrictions, the impl will not require you to restate these restrictions, but it does require you to explicit every lifetime argument everywhere:
struct S<'a, 'b: 'a + 'c, 'c: 'a> {
x: X<'a, 'b, 'c>,
}
impl<'a, 'b, 'c> S<'a, 'b, 'c> {
fn new(x: X<'a, 'b, 'c>) -> S<'a, 'b, 'c> {
S { x }
}
}
As every lifetime for S could be inferred from X’s, I feel that the compiler should accept something along the lines of:
struct S<'a, 'b: 'a + 'c, 'c: 'a> {
x: X<'a, 'b, 'c>,
}
impl<'a, 'b, 'c> S<'a, 'b, 'c> {
fn new(x: X<'a, 'b, 'c>) -> S {
S { x }
}
}
Thoughts?