]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dst/dst-bad-coerce3.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / dst / dst-bad-coerce3.stderr
1 error[E0597]: `f1` does not live long enough
2   --> $DIR/dst-bad-coerce3.rs:16:33
3    |
4 LL |     let f2: &Fat<[isize; 3]> = &f1; //~ ERROR `f1` does not live long enough
5    |                                 ^^ borrowed value does not live long enough
6 ...
7 LL | }
8    | - borrowed value only lives until here
9    |
10 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:8...
11   --> $DIR/dst-bad-coerce3.rs:13:8
12    |
13 LL | fn baz<'a>() {
14    |        ^^
15
16 error[E0597]: `f1` does not live long enough
17   --> $DIR/dst-bad-coerce3.rs:21:26
18    |
19 LL |     let f2: &Fat<Foo> = &f1; //~ ERROR `f1` does not live long enough
20    |                          ^^ borrowed value does not live long enough
21 ...
22 LL | }
23    | - borrowed value only lives until here
24    |
25 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:8...
26   --> $DIR/dst-bad-coerce3.rs:13:8
27    |
28 LL | fn baz<'a>() {
29    |        ^^
30
31 error[E0597]: `f1` does not live long enough
32   --> $DIR/dst-bad-coerce3.rs:26:31
33    |
34 LL |     let f2: &([isize; 3],) = &f1; //~ ERROR `f1` does not live long enough
35    |                               ^^ borrowed value does not live long enough
36 ...
37 LL | }
38    | - borrowed value only lives until here
39    |
40 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:8...
41   --> $DIR/dst-bad-coerce3.rs:13:8
42    |
43 LL | fn baz<'a>() {
44    |        ^^
45
46 error[E0597]: `f1` does not live long enough
47   --> $DIR/dst-bad-coerce3.rs:31:24
48    |
49 LL |     let f2: &(Foo,) = &f1; //~ ERROR `f1` does not live long enough
50    |                        ^^ borrowed value does not live long enough
51 LL |     let f3: &'a (Bar,) = f2;
52 LL | }
53    | - borrowed value only lives until here
54    |
55 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:8...
56   --> $DIR/dst-bad-coerce3.rs:13:8
57    |
58 LL | fn baz<'a>() {
59    |        ^^
60
61 error: aborting due to 4 previous errors
62
63 For more information about this error, try `rustc --explain E0597`.