For example, a variable's lifetime is relative to another variable or function. Why must we create a placeholder name like 'a instead of referring to the other variable by name? Take this example from section 10.3:
fn longest<'a>(x: &'a str, y: &str) -> &'a str {
x
}
Why couldn't we write it as something like the following? fn longest(x: &str, y: &str) -> &'x str {
x
}
Or instead of requiring lifetimes everywhere, the compiler could use conservative defaults but allow optional lifetime annotations to reduce the lifetime if needed or to release memory sooner. For example, in this struct from section 10.3, why is 'a necessary when config is a non-mut reference and thus must outlive a struct App instance? There is a Rust issue filed for this: https://github.com/rust-lang/rfcs/issues/1532 struct App<'a> {
name: String,
config: &'a Config,
}