rust/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr
2018-09-19 20:50:09 +01:00

25 lines
897 B
Plaintext

error: unsatisfied lifetime constraints
--> $DIR/regions-trait-object-subtyping.rs:25:5
|
LL | fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | // Without knowing 'a:'b, we can't coerce
LL | x //~ ERROR lifetime bound not satisfied
| ^ cast requires that `'a` must outlive `'b`
error: unsatisfied lifetime constraints
--> $DIR/regions-trait-object-subtyping.rs:32:5
|
LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut Dummy>) -> Wrapper<&'b mut Dummy> {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | // We can't coerce because it is packed in `Wrapper`
LL | x //~ ERROR mismatched types
| ^ returning this value requires that `'b` must outlive `'a`
error: aborting due to 2 previous errors