write code to extract region names and emit new style message

This commit is contained in:
Niko Matsakis 2018-07-03 11:38:09 -04:00
parent fa02d68eec
commit 727f01700b
49 changed files with 523 additions and 155 deletions

View file

@ -302,7 +302,7 @@ fn main() {
// FIXME(#49824) -- the free region error below should probably not be there
let mut x = 0;
|| {
|| { //[mir]~ ERROR free region `` does not outlive
|| { //[mir]~ ERROR unsatisfied lifetime constraints
let y = &mut x;
&mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
//[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time

View file

@ -14,7 +14,7 @@
fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
let g: fn(_, _) -> _ = |_x, y| y;
//~^ ERROR free region `'b` does not outlive free region `'a`
//~^ ERROR unsatisfied lifetime constraints
g
//~^ WARNING not reporting region error due to nll
}

View file

@ -45,7 +45,7 @@ fn bar<'a>(x: &'a u32) -> &'static u32 {
// as part of checking the `ReifyFnPointer`.
let f: fn(_) -> _ = foo;
//~^ WARNING not reporting region error due to nll
//~| ERROR free region `'a` does not outlive free region `'static`
//~| ERROR unsatisfied lifetime constraints
f(x)
}

View file

@ -17,7 +17,7 @@ fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
// in `g`. These are related via the `UnsafeFnPointer` cast.
let g: unsafe fn(_) -> _ = f;
//~^ WARNING not reporting region error due to nll
//~| ERROR free region `'a` does not outlive free region `'static`
//~| ERROR unsatisfied lifetime constraints
unsafe { g(input) }
}

View file

@ -15,8 +15,7 @@
use std::fmt::Debug;
fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
//~^ ERROR free region `'a` does not outlive free region `'static`
x
x //~ ERROR unsatisfied lifetime constraints
//~^ WARNING not reporting region error due to nll
}

View file

@ -18,7 +18,7 @@ fn static_id_indirect<'a,'b>(t: &'a ()) -> &'static ()
fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
t //[ll]~ ERROR E0312
//[nll]~^ WARNING not reporting region error due to nll
//[nll]~| ERROR free region `'a` does not outlive free region `'static`
//[nll]~| ERROR unsatisfied lifetime constraints
}
fn error(u: &(), v: &()) {

View file

@ -4,11 +4,15 @@ warning: not reporting region error due to nll
LL | give_any(|y| x = Some(y));
| ^
error: free region `` does not outlive free region `'_#2r`
--> $DIR/issue-45983.rs:17:27
error: unsatisfied lifetime constraints
--> $DIR/issue-45983.rs:17:18
|
LL | let x = None;
| - lifetime `'2` appears in the type of `x`
LL | give_any(|y| x = Some(y));
| ^
| - ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
| |
| lifetime `'1` appears in this argument
error[E0594]: cannot assign to immutable item `x`
--> $DIR/issue-45983.rs:17:18

View file

@ -4,11 +4,17 @@ warning: not reporting region error due to nll
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
| ^
error: free region `` does not outlive free region `'_#2r`
error: unsatisfied lifetime constraints
--> $DIR/issue-7573.rs:32:9
|
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
| ---------------- lifetime `'2` appears in the type of `lines_to_use`
LL | //~^ NOTE cannot infer an appropriate lifetime
LL | let push_id = |installed_id: &CrateId| {
| ------------ lifetime `'1` appears in this argument
...
LL | lines_to_use.push(installed_id);
| ^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to previous error

View file

@ -4,11 +4,15 @@ warning: not reporting region error due to nll
LL | with_int(|y| x = Some(y));
| ^
error: free region `` does not outlive free region `'_#2r`
--> $DIR/regions-escape-bound-fn-2.rs:18:27
error: unsatisfied lifetime constraints
--> $DIR/regions-escape-bound-fn-2.rs:18:18
|
LL | let mut x = None;
| ----- lifetime `'2` appears in the type of `x`
LL | with_int(|y| x = Some(y));
| ^
| - ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
| |
| lifetime `'1` appears in this argument
error: aborting due to previous error

View file

@ -4,11 +4,15 @@ warning: not reporting region error due to nll
LL | with_int(|y| x = Some(y));
| ^^^^^^^
error: free region `` does not outlive free region `'_#2r`
--> $DIR/regions-escape-bound-fn.rs:18:27
error: unsatisfied lifetime constraints
--> $DIR/regions-escape-bound-fn.rs:18:18
|
LL | let mut x: Option<&isize> = None;
| ----- lifetime `'2` appears in the type of `x`
LL | with_int(|y| x = Some(y));
| ^
| - ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
| |
| lifetime `'1` appears in this argument
error: aborting due to previous error

View file

@ -4,11 +4,15 @@ warning: not reporting region error due to nll
LL | with_int(&mut |y| x = Some(y));
| ^^^^^^^
error: free region `` does not outlive free region `'_#2r`
--> $DIR/regions-escape-unboxed-closure.rs:16:32
error: unsatisfied lifetime constraints
--> $DIR/regions-escape-unboxed-closure.rs:16:23
|
LL | let mut x: Option<&isize> = None;
| ----- lifetime `'2` appears in the type of `x`
LL | with_int(&mut |y| x = Some(y));
| ^
| - ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
| |
| lifetime `'1` appears in this argument
error: aborting due to previous error

View file

@ -22,23 +22,37 @@ warning: not reporting region error due to nll
LL | f = Some(x);
| ^^^^^^^
error: free region `` does not outlive free region `'_#2r`
--> $DIR/expect-region-supply-region.rs:28:18
error: unsatisfied lifetime constraints
--> $DIR/expect-region-supply-region.rs:28:9
|
LL | let mut f: Option<&u32> = None;
| ----- lifetime `'2` appears in the type of `f`
LL | closure_expecting_bound(|x| {
| - lifetime `'1` appears in this argument
LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
| ^
| ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
error: free region `` does not outlive free region `'_#2r`
--> $DIR/expect-region-supply-region.rs:38:18
error: unsatisfied lifetime constraints
--> $DIR/expect-region-supply-region.rs:38:9
|
LL | let mut f: Option<&u32> = None;
| ----- lifetime `'2` appears in the type of `f`
LL | closure_expecting_bound(|x: &u32| {
| - lifetime `'1` appears in this argument
LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
| ^
| ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
error: free region `` does not outlive free region `'_#2r`
--> $DIR/expect-region-supply-region.rs:52:18
error: unsatisfied lifetime constraints
--> $DIR/expect-region-supply-region.rs:52:9
|
LL | let mut f: Option<&u32> = None;
| ----- lifetime `'2` appears in the type of `f`
...
LL | closure_expecting_bound(|x: &'x u32| {
| - lifetime `'1` appears in this argument
...
LL | f = Some(x);
| ^
| ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
error: aborting due to 3 previous errors

View file

@ -4,11 +4,15 @@ warning: not reporting region error due to nll
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
| ^^^^^^
error: free region `` does not outlive free region `'_#2r`
error: unsatisfied lifetime constraints
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:26
|
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
| ^^^^^
| ----------^^^^^-----------------
| | | |
| | | free region requires that `'1` must outlive `'2`
| | lifetime `'1` appears in this argument
| lifetime `'2` appears in return type
error: aborting due to previous error

View file

@ -10,17 +10,19 @@ warning: not reporting region error due to nll
LL | self.x.iter().map(|a| a.0)
| ^^^^
error: free region `` does not outlive free region `'static`
error: unsatisfied lifetime constraints
--> $DIR/static-return-lifetime-infered.rs:17:9
|
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
| ----- lifetime `'1` appears in this argument
LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^
| ^^^^^^ cast requires that `'1` must outlive `'static`
error: free region `'a` does not outlive free region `'static`
error: unsatisfied lifetime constraints
--> $DIR/static-return-lifetime-infered.rs:21:9
|
LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^
| ^^^^^^ cast requires that `'a` must outlive `'static`
error: aborting due to 2 previous errors

View file

@ -4,11 +4,11 @@ warning: not reporting region error due to nll
LL | static_val(x); //~ ERROR cannot infer
| ^
error: free region `'a` does not outlive free region `'static`
error: unsatisfied lifetime constraints
--> $DIR/dyn-trait.rs:32:5
|
LL | static_val(x); //~ ERROR cannot infer
| ^^^^^^^^^^^^^
| ^^^^^^^^^^^^^ argument requires that `'a` must outlive `'static`
error: aborting due to previous error

View file

@ -34,7 +34,7 @@ fn test() {
{
let y = 22;
let mut closure = expect_sig(|p, y| *p = y);
//~^ ERROR does not outlive free region
//~^ ERROR
//~| WARNING not reporting region error due to nll
closure(&mut p, &y);
}

View file

@ -4,11 +4,14 @@ warning: not reporting region error due to nll
LL | let mut closure = expect_sig(|p, y| *p = y);
| ^
error: free region `ReFree(DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]), BrAnon(3))` does not outlive free region `ReFree(DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]), BrAnon(2))`
error: unsatisfied lifetime constraints
--> $DIR/escape-argument-callee.rs:36:45
|
LL | let mut closure = expect_sig(|p, y| *p = y);
| ^^^^^^
| - - ^^^^^^ free region requires that `'1` must outlive `'2`
| | |
| | lifetime `'1` appears in this argument
| lifetime `'2` appears in this argument
note: No external requirements
--> $DIR/escape-argument-callee.rs:36:38

View file

@ -54,8 +54,7 @@ fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell
// Only works if 'x: 'y:
let p = x.get();
//~^ WARN not reporting region error due to nll
//~| ERROR does not outlive free region
demand_y(x, y, p)
demand_y(x, y, p) //~ ERROR
},
);
}

View file

@ -4,11 +4,16 @@ warning: not reporting region error due to nll
LL | let p = x.get();
| ^^^^^^^
error: free region `ReFree(DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]), BrAnon(1))` does not outlive free region `ReFree(DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`
--> $DIR/propagate-approximated-fail-no-postdom.rs:55:17
error: unsatisfied lifetime constraints
--> $DIR/propagate-approximated-fail-no-postdom.rs:57:13
|
LL | let p = x.get();
| ^
LL | |_outlives1, _outlives2, _outlives3, x, y| {
| ---------- ---------- lifetime `'2` appears in this argument
| |
| lifetime `'1` appears in this argument
...
LL | demand_y(x, y, p) //~ ERROR
| ^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
note: No external requirements
--> $DIR/propagate-approximated-fail-no-postdom.rs:53:9
@ -17,8 +22,7 @@ LL | / |_outlives1, _outlives2, _outlives3, x, y| {
LL | | // Only works if 'x: 'y:
LL | | let p = x.get();
LL | | //~^ WARN not reporting region error due to nll
LL | | //~| ERROR does not outlive free region
LL | | demand_y(x, y, p)
LL | | demand_y(x, y, p) //~ ERROR
LL | | },
| |_________^
|

View file

@ -31,7 +31,7 @@ fn case1() {
foo(cell, |cell_a, cell_x| {
//~^ WARNING not reporting region error due to nll
cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
//~^ ERROR argument requires that data must outlive free region
//~^ ERROR
})
}

View file

@ -4,11 +4,16 @@ warning: not reporting region error due to nll
LL | foo(cell, |cell_a, cell_x| {
| ^^^
error: argument requires that data must outlive free region `'_#1r`
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:20
error: unsatisfied lifetime constraints
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9
|
LL | foo(cell, |cell_a, cell_x| {
| ------ ------ lifetime `'1` appears in this argument
| |
| lifetime `'2` appears in this argument
LL | //~^ WARNING not reporting region error due to nll
LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
| ^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
note: No external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:31:15
@ -17,7 +22,7 @@ LL | foo(cell, |cell_a, cell_x| {
| _______________^
LL | | //~^ WARNING not reporting region error due to nll
LL | | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
LL | | //~^ ERROR argument requires that data must outlive free region
LL | | //~^ ERROR
LL | | })
| |_____^
|

View file

@ -43,7 +43,7 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
#[rustc_regions]
fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
//~^ ERROR argument requires that data must outlive free region
//~^ ERROR
// Only works if 'x: 'y:
demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll

View file

@ -9,7 +9,7 @@ note: External requirements
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| _______________________________________________^
LL | | //~^ ERROR argument requires that data must outlive free region
LL | | //~^ ERROR
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
@ -23,23 +23,23 @@ LL | | });
= note: number of external vids: 2
= note: where '_#1r: '_#0r
error: argument requires that data must outlive free region `ReStatic`
error: unsatisfied lifetime constraints
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:5
|
LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
LL | | //~^ ERROR argument requires that data must outlive free region
LL | | //~^ ERROR
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
LL | | });
| |______^
| |______^ argument requires that `'a` must outlive `'static`
note: No external requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1
|
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
LL | | //~^ ERROR argument requires that data must outlive free region
LL | | //~^ ERROR
LL | |
... |
LL | | });

View file

@ -46,7 +46,7 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
#[rustc_regions]
fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
//~^ ERROR argument requires that data must outlive free region
//~^ ERROR
// Only works if 'x: 'y:
demand_y(x, y, x.get())
//~^ WARNING not reporting region error due to nll

View file

@ -9,7 +9,7 @@ note: External requirements
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| _______________________________________________^
LL | | //~^ ERROR argument requires that data must outlive free region
LL | | //~^ ERROR
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | //~^ WARNING not reporting region error due to nll
@ -23,23 +23,23 @@ LL | | });
= note: number of external vids: 3
= note: where '_#1r: '_#0r
error: argument requires that data must outlive free region `ReStatic`
error: unsatisfied lifetime constraints
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:5
|
LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
LL | | //~^ ERROR argument requires that data must outlive free region
LL | | //~^ ERROR
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | //~^ WARNING not reporting region error due to nll
LL | | });
| |______^
| |______^ argument requires that `'a` must outlive `'static`
note: No external requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:47:1
|
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
LL | | //~^ ERROR argument requires that data must outlive free region
LL | | //~^ ERROR
LL | | // Only works if 'x: 'y:
... |
LL | | });

View file

@ -46,7 +46,7 @@ fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
// Only works if 'x: 'y:
demand_y(x, y, x.get())
//~^ WARN not reporting region error due to nll
//~| ERROR argument requires that data must outlive free region
//~| ERROR
});
}

View file

@ -4,11 +4,16 @@ warning: not reporting region error due to nll
LL | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^
error: argument requires that data must outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`
error: unsatisfied lifetime constraints
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:47:9
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| --------- - lifetime `'1` appears in this argument
| |
| lifetime `'2` appears in this argument
LL | // Only works if 'x: 'y:
LL | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
note: No external requirements
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:45:47
@ -18,7 +23,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | //~^ WARN not reporting region error due to nll
LL | | //~| ERROR argument requires that data must outlive free region
LL | | //~| ERROR
LL | | });
| |_____^
|

View file

@ -50,7 +50,7 @@ fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
// Only works if 'x: 'y:
demand_y(x, y, x.get())
//~^ WARN not reporting region error due to nll
//~| ERROR does not outlive free region
//~| ERROR
});
}

View file

@ -4,11 +4,16 @@ warning: not reporting region error due to nll
LL | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^
error: free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))` does not outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(4))`
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:18
error: unsatisfied lifetime constraints
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:9
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| ---------- ---------- lifetime `'2` appears in this argument
| |
| lifetime `'1` appears in this argument
LL | // Only works if 'x: 'y:
LL | demand_y(x, y, x.get())
| ^
| ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
note: No external requirements
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:49:47
@ -18,7 +23,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x,
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | //~^ WARN not reporting region error due to nll
LL | | //~| ERROR does not outlive free region
LL | | //~| ERROR
LL | | });
| |_____^
|

View file

@ -18,7 +18,7 @@
fn foo<'a>(x: &'a u32) -> &'static u32 {
&*x
//~^ WARN not reporting region error due to nll
//~| ERROR does not outlive free region
//~| ERROR
}
fn main() { }

View file

@ -4,11 +4,11 @@ warning: not reporting region error due to nll
LL | &*x
| ^^^
error: free region `ReFree(DefId(0/0:3 ~ region_lbr_named_does_not_outlive_static[317d]::foo[0]), BrNamed(crate0:DefIndex(1:9), 'a))` does not outlive free region `ReStatic`
error: unsatisfied lifetime constraints
--> $DIR/region-lbr-named-does-not-outlive-static.rs:19:5
|
LL | &*x
| ^^^
| ^^^ free region requires that `'a` must outlive `'static`
error: aborting due to previous error

View file

@ -20,7 +20,7 @@
fn test() {
expect_sig(|a, b| b); // ought to return `a`
//~^ WARN not reporting region error due to nll
//~| ERROR does not outlive free region
//~| ERROR
}
fn expect_sig<F>(f: F) -> F

View file

@ -4,11 +4,14 @@ warning: not reporting region error due to nll
LL | expect_sig(|a, b| b); // ought to return `a`
| ^
error: free region `ReFree(DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]), BrAnon(2))` does not outlive free region `ReFree(DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]), BrAnon(1))`
error: unsatisfied lifetime constraints
--> $DIR/return-wrong-bound-region.rs:21:23
|
LL | expect_sig(|a, b| b); // ought to return `a`
| ^
| - - ^ free region requires that `'1` must outlive `'2`
| | |
| | lifetime `'1` appears in this argument
| lifetime `'2` appears in this argument
note: No external requirements
--> $DIR/return-wrong-bound-region.rs:21:16
@ -27,7 +30,7 @@ note: No external requirements
LL | / fn test() {
LL | | expect_sig(|a, b| b); // ought to return `a`
LL | | //~^ WARN not reporting region error due to nll
LL | | //~| ERROR does not outlive free region
LL | | //~| ERROR
LL | | }
| |_^
|

View file

@ -18,5 +18,5 @@ fn use_val<'a>(val: &'a u8) -> &'a u8 {
fn main() {
let orig: u8 = 5;
move || use_val(&orig); //~ ERROR free region `` does not outlive free region `'_#1r`
move || use_val(&orig); //~ ERROR
}

View file

@ -1,8 +1,12 @@
error: free region `` does not outlive free region `'_#1r`
--> $DIR/issue-48238.rs:21:21
error: unsatisfied lifetime constraints
--> $DIR/issue-48238.rs:21:13
|
LL | move || use_val(&orig); //~ ERROR free region `` does not outlive free region `'_#1r`
| ^^^^^
LL | move || use_val(&orig); //~ ERROR
| --------^^^^^^^^^^^^^^
| | |
| | argument requires that `'1` must outlive `'2`
| lifetime `'1` represents the closure body
| lifetime `'2` appears in return type
error: aborting due to previous error

View file

@ -22,7 +22,7 @@ where
for<'b> &'b T: A,
<&'static T as A>::X: Sized
{
let _x = *s; //~ ERROR assignment requires that data must outlive free region `'static`
let _x = *s; //~ ERROR
}
fn main() {}

View file

@ -1,8 +1,8 @@
error: assignment requires that data must outlive free region `'static`
error: unsatisfied lifetime constraints
--> $DIR/issue-50716.rs:25:14
|
LL | let _x = *s; //~ ERROR assignment requires that data must outlive free region `'static`
| ^^
LL | let _x = *s; //~ ERROR
| ^^ assignment requires that `'a` must outlive `'static`
error: aborting due to previous error

View file

@ -55,7 +55,7 @@ where
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR the parameter type `T` may not live long enough
//~| ERROR argument requires that data must outlive free region
//~| ERROR
}
#[rustc_regions]
@ -67,7 +67,7 @@ where
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR the parameter type `T` may not live long enough
//~| ERROR argument requires that data must outlive free region
//~| ERROR
}
#[rustc_regions]
@ -89,7 +89,7 @@ where
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR the parameter type `T` may not live long enough
//~| ERROR argument requires that data must outlive free region
//~| ERROR
}
#[rustc_regions]

View file

@ -40,11 +40,11 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
|
= help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`...
error: argument requires that data must outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-closure.rs:55:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-closure.rs:51:1
@ -54,7 +54,7 @@ LL | | where
LL | | T: Anything<'b>,
LL | | {
... |
LL | | //~| ERROR argument requires that data must outlive free region
LL | | //~| ERROR
LL | | }
| |_^
|
@ -88,11 +88,11 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
|
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
error: argument requires that data must outlive free region `ReEarlyBound(0, 'a)`
error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-closure.rs:67:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-closure.rs:62:1
@ -102,7 +102,7 @@ LL | | where
LL | | T: Anything<'b>,
LL | | 'a: 'a,
... |
LL | | //~| ERROR argument requires that data must outlive free region
LL | | //~| ERROR
LL | | }
| |_^
|
@ -137,11 +137,11 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
|
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
error: argument requires that data must outlive free region `ReEarlyBound(0, 'a)`
error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-closure.rs:89:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-closure.rs:74:1
@ -151,7 +151,7 @@ LL | | where
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
... |
LL | | //~| ERROR argument requires that data must outlive free region
LL | | //~| ERROR
LL | | }
| |_^
|

View file

@ -46,7 +46,7 @@ where
{
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR argument requires that data must outlive free region
//~| ERROR
}
#[rustc_regions]
@ -57,7 +57,7 @@ where
{
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR argument requires that data must outlive free region
//~| ERROR
}
#[rustc_regions]
@ -78,7 +78,7 @@ where
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR argument requires that data must outlive free region
//~| ERROR
}
#[rustc_regions]

View file

@ -31,11 +31,11 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
= note: number of external vids: 3
= note: where '_#1r: '_#2r
error: argument requires that data must outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-trait-bound-closure.rs:47:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:43:1
@ -45,7 +45,7 @@ LL | | where
LL | | T: Anything<'b>,
LL | | {
... |
LL | | //~| ERROR argument requires that data must outlive free region
LL | | //~| ERROR
LL | | }
| |_^
|
@ -70,11 +70,11 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
= note: number of external vids: 4
= note: where '_#2r: '_#3r
error: argument requires that data must outlive free region `ReEarlyBound(0, 'a)`
error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-trait-bound-closure.rs:58:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:53:1
@ -84,7 +84,7 @@ LL | | where
LL | | T: Anything<'b>,
LL | | 'a: 'a,
... |
LL | | //~| ERROR argument requires that data must outlive free region
LL | | //~| ERROR
LL | | }
| |_^
|
@ -110,11 +110,11 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
= note: number of external vids: 4
= note: where '_#2r: '_#3r
error: argument requires that data must outlive free region `ReEarlyBound(0, 'a)`
error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-trait-bound-closure.rs:79:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:64:1
@ -124,7 +124,7 @@ LL | | where
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
... |
LL | | //~| ERROR argument requires that data must outlive free region
LL | | //~| ERROR
LL | | }
| |_^
|

View file

@ -107,7 +107,7 @@ where
{
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR argument requires that data must outlive free region
//~| ERROR
}
#[rustc_regions]

View file

@ -239,11 +239,11 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
= note: number of external vids: 3
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
error: argument requires that data must outlive free region `ReFree(DefId(0/0:13 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]), BrNamed(crate0:DefIndex(1:43), 'a))`
error: unsatisfied lifetime constraints
--> $DIR/projection-two-region-trait-bound-closure.rs:108:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:104:1
@ -253,7 +253,7 @@ LL | | where
LL | | T: Anything<'b, 'b>,
LL | | {
... |
LL | | //~| ERROR argument requires that data must outlive free region
LL | | //~| ERROR
LL | | }
| |_^
|

View file

@ -22,11 +22,14 @@ warning: not reporting region error due to nll
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^^^^^^^^^^^^^^^^^^
error: cast requires that data must outlive free region `'static`
error: unsatisfied lifetime constraints
--> $DIR/dyn-trait-underscore.rs:18:5
|
LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
| ----- lifetime `'1` appears in this argument
LL | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`
error: aborting due to previous error