rust/src/test/ui/regions/regions-free-region-ordering-caller.mir.stderr
Matthew Jasper 65fe251634 Handle lifetime annotations in unreachable code
We  equate the type in the annotation with the inferred type first so
that we have a fully inferred type to perform the well-formedness check
on.
2019-01-19 16:30:45 +00:00

34 lines
1.3 KiB
Plaintext

error: lifetime may not live long enough
--> $DIR/regions-free-region-ordering-caller.rs:11:12
|
LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | let z: Option<&'b &'a usize> = None;//[ast]~ ERROR E0623
| ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b`
error: lifetime may not live long enough
--> $DIR/regions-free-region-ordering-caller.rs:17:12
|
LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | let y: Paramd<'a> = Paramd { x: a };
LL | let z: Option<&'b Paramd<'a>> = None;//[ast]~ ERROR E0623
| ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b`
error: lifetime may not live long enough
--> $DIR/regions-free-region-ordering-caller.rs:22:12
|
LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | let z: Option<&'a &'b usize> = None;//[ast]~ ERROR E0623
| ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
error: aborting due to 3 previous errors