struct Cat { // data } struct Person<'a> { cat: &'a Cat, // because cats can be shared } impl<'a> Person<'a> { fn new(cat: &'a Cat, second_cat: &Cat) -> Person<'a> { Person { cat } } } fn good_lifetime_use() { let cat = Cat {}; // this compiles: the other_cat does not have to be valid for the Person to be valid let p = { let other_cat = Cat {}; Person::new(&cat, &other_cat) }; } // this does not compile: the variable `other_cat`` needs to be valid for the Person to ba valid // but `other _cat` reaches the end of its scope... fn bad_lifetime_use() { let cat = Cat {}; let p = { let other_cat = Cat {}; Person::new(&other_cat, &cat) }; }