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 | -- -- also has lifetime `'y`
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` will be dropped here, when the function `silly` returns
15 = help: use data from the highlighted arguments which match the `'y` lifetime of the return type
16 = note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
17 = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch04-02-references-and-borrowing.html#dangling-references>
19 error: aborting due to previous error
21 For more information about this error, try `rustc --explain E0597`.