1 error[E0597]: `x` does not live long enough
2 --> $DIR/issue-30438-c.rs:19:5
4 LL | fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y <Test<'z> as Trait>::Out where 'z: 'static {
5 | ------------ ---------------------------- has type `&'y <Test<'z> as Trait>::Out`
7 | has type `&'y Test<'z>`
8 LL | let x = Test { s: "this cannot last" };
10 | ^^ `x` would have to be valid for `'y`
11 LL | //~^ ERROR: `x` does not live long enough
13 | - ...but `x` is only valid for the duration of the `silly` function, so it is dropped here while still borrowed
15 = note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
16 = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch04-02-references-and-borrowing.html#dangling-references>
18 error: aborting due to previous error
20 For more information about this error, try `rustc --explain E0597`.