bless polonius output due to lacking the 'static special-casing

This commit is contained in:
Remy Rakic 2019-12-02 18:54:42 +01:00
parent 695640816a
commit 720716f9d0
3 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,56 @@
error[E0521]: borrowed data escapes outside of closure
--> $DIR/expect-region-supply-region.rs:18:9
|
LL | let mut f: Option<&u32> = None;
| ----- `f` is declared here, outside of the closure body
LL | closure_expecting_bound(|x| {
| - `x` is a reference that is only valid in the closure body
LL | f = Some(x);
| ^^^^^^^^^^^ `x` escapes the closure body here
error[E0521]: borrowed data escapes outside of closure
--> $DIR/expect-region-supply-region.rs:28:9
|
LL | let mut f: Option<&u32> = None;
| ----- `f` is declared here, outside of the closure body
LL | closure_expecting_bound(|x: &u32| {
| - `x` is a reference that is only valid in the closure body
LL | f = Some(x);
| ^^^^^^^^^^^ `x` escapes the closure body here
error: lifetime may not live long enough
--> $DIR/expect-region-supply-region.rs:37:30
|
LL | fn expect_bound_supply_named<'x>() {
| -- lifetime `'x` defined here
...
LL | closure_expecting_bound(|x: &'x u32| {
| ^ - let's call the lifetime of this reference `'1`
| |
| requires that `'1` must outlive `'x`
error[E0521]: borrowed data escapes outside of closure
--> $DIR/expect-region-supply-region.rs:42:9
|
LL | let mut f: Option<&u32> = None;
| ----- `f` is declared here, outside of the closure body
...
LL | closure_expecting_bound(|x: &'x u32| {
| - `x` is a reference that is only valid in the closure body
...
LL | f = Some(x);
| ^^^^^^^^^^^ `x` escapes the closure body here
error: lifetime may not live long enough
--> $DIR/expect-region-supply-region.rs:37:30
|
LL | fn expect_bound_supply_named<'x>() {
| -- lifetime `'x` defined here
...
LL | closure_expecting_bound(|x: &'x u32| {
| ^ requires that `'x` must outlive `'static`
|
= help: consider replacing `'x` with `'static`
error: aborting due to 5 previous errors

View File

@ -0,0 +1,12 @@
error: lifetime may not live long enough
--> $DIR/error-handling.rs:13:56
|
LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
| -- -- lifetime `'b` defined here ^^^^^^^^^ opaque type requires that `'a` must outlive `'b`
| |
| lifetime `'a` defined here
|
= help: consider adding the following bound: `'a: 'b`
error: aborting due to previous error

View File

@ -0,0 +1,60 @@
error: lifetime may not live long enough
--> $DIR/closure-substs.rs:8:16
|
LL | fn foo<'a>() {
| -- lifetime `'a` defined here
...
LL | return x;
| ^ returning this value requires that `'a` must outlive `'static`
|
= help: consider replacing `'a` with `'static`
error: lifetime may not live long enough
--> $DIR/closure-substs.rs:15:16
|
LL | |x: &i32| -> &'static i32 {
| - let's call the lifetime of this reference `'1`
LL | return x;
| ^ returning this value requires that `'1` must outlive `'static`
error: lifetime may not live long enough
--> $DIR/closure-substs.rs:15:16
|
LL | |x: &i32| -> &'static i32 {
| - ------------ return type of closure is &'2 i32
| |
| let's call the lifetime of this reference `'1`
LL | return x;
| ^ returning this value requires that `'1` must outlive `'2`
error: lifetime may not live long enough
--> $DIR/closure-substs.rs:22:9
|
LL | fn bar<'a>() {
| -- lifetime `'a` defined here
...
LL | b(x);
| ^^^^ argument requires that `'a` must outlive `'static`
|
= help: consider replacing `'a` with `'static`
error[E0521]: borrowed data escapes outside of closure
--> $DIR/closure-substs.rs:29:9
|
LL | |x: &i32, b: fn(&'static i32)| {
| - `x` is a reference that is only valid in the closure body
LL | b(x);
| ^^^^ `x` escapes the closure body here
error[E0521]: borrowed data escapes outside of closure
--> $DIR/closure-substs.rs:29:9
|
LL | |x: &i32, b: fn(&'static i32)| {
| - - `b` is declared here, outside of the closure body
| |
| `x` is a reference that is only valid in the closure body
LL | b(x);
| ^^^^ `x` escapes the closure body here
error: aborting due to 6 previous errors