fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0597]: `f1` does not live long enough 2 --> $DIR/dst-bad-coerce3.rs:16:32 3 | 4LL | fn baz<'a>() { 5 | -- lifetime `'a` defined here 6LL | // With a vec of ints. 7LL | let f1 = Fat { ptr: [1, 2, 3] }; 8 | -- binding `f1` declared here 9LL | let f2: &Fat<[isize; 3]> = &f1; 10 | ^^^ borrowed value does not live long enough 11LL | let f3: &'a Fat<[isize]> = f2; 12 | ---------------- type annotation requires that `f1` is borrowed for `'a` 13... 14LL | } 15 | - `f1` dropped here while still borrowed 16 17error[E0597]: `f1` does not live long enough 18 --> $DIR/dst-bad-coerce3.rs:21:25 19 | 20LL | fn baz<'a>() { 21 | -- lifetime `'a` defined here 22... 23LL | let f1 = Fat { ptr: Foo }; 24 | -- binding `f1` declared here 25LL | let f2: &Fat<Foo> = &f1; 26 | ^^^ borrowed value does not live long enough 27LL | let f3: &'a Fat<dyn Bar> = f2; 28 | ---------------- type annotation requires that `f1` is borrowed for `'a` 29... 30LL | } 31 | - `f1` dropped here while still borrowed 32 33error[E0597]: `f1` does not live long enough 34 --> $DIR/dst-bad-coerce3.rs:26:30 35 | 36LL | fn baz<'a>() { 37 | -- lifetime `'a` defined here 38... 39LL | let f1 = ([1, 2, 3],); 40 | -- binding `f1` declared here 41LL | let f2: &([isize; 3],) = &f1; 42 | ^^^ borrowed value does not live long enough 43LL | let f3: &'a ([isize],) = f2; 44 | -------------- type annotation requires that `f1` is borrowed for `'a` 45... 46LL | } 47 | - `f1` dropped here while still borrowed 48 49error[E0597]: `f1` does not live long enough 50 --> $DIR/dst-bad-coerce3.rs:31:23 51 | 52LL | fn baz<'a>() { 53 | -- lifetime `'a` defined here 54... 55LL | let f1 = (Foo,); 56 | -- binding `f1` declared here 57LL | let f2: &(Foo,) = &f1; 58 | ^^^ borrowed value does not live long enough 59LL | let f3: &'a (dyn Bar,) = f2; 60 | -------------- type annotation requires that `f1` is borrowed for `'a` 61LL | } 62 | - `f1` dropped here while still borrowed 63 64error: aborting due to 4 previous errors 65 66For more information about this error, try `rustc --explain E0597`.