]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-11681.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-11681.stderr
1 error[E0597]: borrowed value does not live long enough
2   --> $DIR/issue-11681.rs:22:20
3    |
4 LL |   let testValue = &Test; //~ ERROR borrowed value does not live long enough
5    |                    ^^^^ temporary value does not live long enough
6 LL |   return testValue;
7 LL | }
8    | - temporary value only lives until here
9    |
10 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:15...
11   --> $DIR/issue-11681.rs:21:15
12    |
13 LL | fn createTest<'a>() -> &'a Test {
14    |               ^^
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0597`.