Closed
Description
Generate error message for the case where , for structs, we have missing lifetime parameters.
For e.g. a sample error message
struct Ref<'a> { x: &'a u32 }
fn foo(mut x: Vec<Ref>, y: Ref) {
--- --- must have the same lifetime
x.push(y);
| ^ data from `y` flows into `x` here
}
There are cases where more than one lifetime parameters come into play.
struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
fn foo(mut x: Ref, y: Ref) {
--- --- 2nd lifetime parameter on `Ref` must match
2nd lifetime parameter on `Ref` must match
x.b = y.b;
}
struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
fn foo<'x1, 'x2, 'y1>(mut x: Ref<'x1, 'x2>, y: Ref<'y1, 'y2>) {
x.b = y.b;
}