2018-08-08 07:28:26 -05:00
|
|
|
error[E0597]: `f1` does not live long enough
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/dst-bad-coerce3.rs:16:32
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | fn baz<'a>() {
|
|
|
|
| -- lifetime `'a` defined here
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | // With a vec of ints.
|
|
|
|
LL | let f1 = Fat { ptr: [1, 2, 3] };
|
|
|
|
| -- binding `f1` declared here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let f2: &Fat<[isize; 3]> = &f1;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^ borrowed value does not live long enough
|
|
|
|
LL | let f3: &'a Fat<[isize]> = f2;
|
|
|
|
| ---------------- type annotation requires that `f1` is borrowed for `'a`
|
2018-08-08 07:28:26 -05:00
|
|
|
...
|
|
|
|
LL | }
|
2019-04-22 02:40:08 -05:00
|
|
|
| - `f1` dropped here while still borrowed
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0597]: `f1` does not live long enough
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/dst-bad-coerce3.rs:21:25
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | fn baz<'a>() {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
...
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | let f1 = Fat { ptr: Foo };
|
|
|
|
| -- binding `f1` declared here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let f2: &Fat<Foo> = &f1;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^ borrowed value does not live long enough
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | let f3: &'a Fat<dyn Bar> = f2;
|
|
|
|
| ---------------- type annotation requires that `f1` is borrowed for `'a`
|
2018-08-08 07:28:26 -05:00
|
|
|
...
|
|
|
|
LL | }
|
2019-04-22 02:40:08 -05:00
|
|
|
| - `f1` dropped here while still borrowed
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0597]: `f1` does not live long enough
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/dst-bad-coerce3.rs:26:30
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | fn baz<'a>() {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
...
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | let f1 = ([1, 2, 3],);
|
|
|
|
| -- binding `f1` declared here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let f2: &([isize; 3],) = &f1;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^ borrowed value does not live long enough
|
|
|
|
LL | let f3: &'a ([isize],) = f2;
|
|
|
|
| -------------- type annotation requires that `f1` is borrowed for `'a`
|
2018-08-08 07:28:26 -05:00
|
|
|
...
|
|
|
|
LL | }
|
2019-04-22 02:40:08 -05:00
|
|
|
| - `f1` dropped here while still borrowed
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0597]: `f1` does not live long enough
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/dst-bad-coerce3.rs:31:23
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | fn baz<'a>() {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
...
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | let f1 = (Foo,);
|
|
|
|
| -- binding `f1` declared here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let f2: &(Foo,) = &f1;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^ borrowed value does not live long enough
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | let f3: &'a (dyn Bar,) = f2;
|
|
|
|
| -------------- type annotation requires that `f1` is borrowed for `'a`
|
2018-08-08 07:28:26 -05:00
|
|
|
LL | }
|
2019-04-22 02:40:08 -05:00
|
|
|
| - `f1` dropped here while still borrowed
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|