Why can the lifetimes not be elided in a struct definition?
问题 struct Point { x: u32, y: u32, } struct Line<\'a> { start: &\'a Point, end: &\'a Point, } Here, the only possible option for the start and end fields is to have a lifetime the same or longer than the Line variable that contains them. I can\'t even imagine how one will go about using a lifetime specifier to say that the fields have a shorter lifespan. Why do I have to explicitly specify a lifetime here? Is elision not possible in this situation and if so why not? 回答1: When you define a struct,