fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
865 B24 linesraw
1error: lifetime may not live long enough
2  --> $DIR/regions-trait-object-subtyping.rs:15:5
3   |
4LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
5   |         -- -- lifetime `'b` defined here
6   |         |
7   |         lifetime `'a` defined here
8LL |     // Without knowing 'a:'b, we can't coerce
9LL |     x
10   |     ^ returning this value requires that `'a` must outlive `'b`
11
12error: lifetime may not live long enough
13  --> $DIR/regions-trait-object-subtyping.rs:22:5
14   |
15LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> {
16   |         --    -- lifetime `'b` defined here
17   |         |
18   |         lifetime `'a` defined here
19LL |     // We can't coerce because it is packed in `Wrapper`
20LL |     x
21   |     ^ returning this value requires that `'b` must outlive `'a`
22
23error: aborting due to 2 previous errors
24