Update tests
This commit is contained in:
parent
2f8a77445f
commit
274d293cab
@ -9,7 +9,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
|
||||
for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) i32))
|
||||
]
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/escape-argument-callee.rs:26:45
|
||||
|
|
||||
LL | let mut closure = expect_sig(|p, y| *p = y);
|
||||
|
@ -16,7 +16,7 @@ LL | | },
|
||||
= note: late-bound region is '_#5r
|
||||
= note: late-bound region is '_#6r
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/propagate-approximated-fail-no-postdom.rs:46:13
|
||||
|
|
||||
LL | |_outlives1, _outlives2, _outlives3, x, y| {
|
||||
|
@ -41,10 +41,9 @@ 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| {
|
||||
|
||||
// Only works if 'x: 'y:
|
||||
demand_y(x, y, x.get())
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3,10 +3,9 @@ note: External requirements
|
||||
|
|
||||
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
|
||||
| _______________________________________________^
|
||||
LL | |
|
||||
LL | | // Only works if 'x: 'y:
|
||||
LL | | demand_y(x, y, x.get())
|
||||
LL | | //~^ ERROR unsatisfied lifetime constraints
|
||||
LL | | //~^ ERROR lifetime may not live long enough
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
|
||||
@ -24,17 +23,17 @@ note: No external requirements
|
||||
|
|
||||
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 | |
|
||||
LL | | // Only works if 'x: 'y:
|
||||
... |
|
||||
LL | | demand_y(x, y, x.get())
|
||||
LL | | //~^ ERROR lifetime may not live long enough
|
||||
LL | | });
|
||||
LL | | }
|
||||
| |_^
|
||||
|
|
||||
= note: defining type: DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]) with substs []
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
--> $DIR/propagate-approximated-ref.rs:46:9
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/propagate-approximated-ref.rs:45:9
|
||||
|
|
||||
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
|
||||
| -- -- lifetime `'b` defined here
|
||||
|
@ -34,10 +34,9 @@ fn demand_y<'x, 'y>(_outlives1: Cell<&&'x u32>, _outlives2: Cell<&'y &u32>, _y:
|
||||
#[rustc_regions]
|
||||
fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
|
||||
establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
|
||||
|
||||
// Only works if 'x: 'y:
|
||||
demand_y(outlives1, outlives2, x.get())
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3,10 +3,9 @@ note: External requirements
|
||||
|
|
||||
LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
|
||||
| _____________________________________________^
|
||||
LL | |
|
||||
LL | | // Only works if 'x: 'y:
|
||||
LL | | demand_y(outlives1, outlives2, x.get())
|
||||
LL | | //~^ ERROR unsatisfied lifetime constraints
|
||||
LL | | //~^ ERROR lifetime may not live long enough
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
|
||||
@ -24,17 +23,17 @@ note: No external requirements
|
||||
|
|
||||
LL | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
|
||||
LL | | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
|
||||
LL | |
|
||||
LL | | // Only works if 'x: 'y:
|
||||
... |
|
||||
LL | | demand_y(outlives1, outlives2, x.get())
|
||||
LL | | //~^ ERROR lifetime may not live long enough
|
||||
LL | | });
|
||||
LL | | }
|
||||
| |_^
|
||||
|
|
||||
= note: defining type: DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]) with substs []
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
--> $DIR/propagate-approximated-val.rs:39:9
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/propagate-approximated-val.rs:38:9
|
||||
|
|
||||
LL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
|
||||
| -- -- lifetime `'b` defined here
|
||||
|
@ -16,7 +16,7 @@ LL | | });
|
||||
= note: late-bound region is '_#2r
|
||||
= note: late-bound region is '_#3r
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:37:9
|
||||
|
|
||||
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
|
||||
|
@ -16,7 +16,7 @@ LL | | });
|
||||
= note: late-bound region is '_#3r
|
||||
= note: late-bound region is '_#4r
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:41:9
|
||||
|
|
||||
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/region-lbr-named-does-not-outlive-static.rs:9:5
|
||||
|
|
||||
LL | fn foo<'a>(x: &'a u32) -> &'static u32 {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
|
||||
&*x
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
fn main() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/region-lbr1-does-not-outlive-ebr2.rs:9:5
|
||||
|
|
||||
LL | fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
|
||||
|
@ -9,7 +9,7 @@ LL | expect_sig(|a, b| b); // ought to return `a`
|
||||
for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32
|
||||
]
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/return-wrong-bound-region.rs:11:23
|
||||
|
|
||||
LL | expect_sig(|a, b| b); // ought to return `a`
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-48238.rs:11:13
|
||||
|
|
||||
LL | move || use_val(&orig); //~ ERROR
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-50716.rs:16:14
|
||||
|
|
||||
LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
|
||||
|
@ -3,8 +3,8 @@
|
||||
#![allow(warnings)]
|
||||
#![feature(nll)]
|
||||
|
||||
trait Bazinga { }
|
||||
impl<F> Bazinga for F { }
|
||||
trait Bazinga {}
|
||||
impl<F> Bazinga for F {}
|
||||
|
||||
fn produce1<'a>(data: &'a u32) -> impl Bazinga + 'a {
|
||||
let x = move || {
|
||||
@ -21,7 +21,6 @@ fn produce2<'a>(data: &'a mut Vec<&'a u32>, value: &'a u32) -> impl Bazinga + 'a
|
||||
x
|
||||
}
|
||||
|
||||
|
||||
fn produce3<'a, 'b: 'a>(data: &'a mut Vec<&'a u32>, value: &'b u32) -> impl Bazinga + 'a {
|
||||
let x = move || {
|
||||
let value: &'a u32 = value;
|
||||
@ -35,7 +34,7 @@ fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl B
|
||||
let value: &'a u32 = value;
|
||||
data.push(value);
|
||||
};
|
||||
x //~ ERROR unsatisfied lifetime constraints
|
||||
x //~ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
fn main() {}
|
||||
|
@ -1,12 +1,12 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
--> $DIR/issue-52113.rs:38:5
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-52113.rs:37:5
|
||||
|
|
||||
LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
|
||||
| -- -- lifetime `'b` defined here
|
||||
| |
|
||||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | x //~ ERROR unsatisfied lifetime constraints
|
||||
LL | x //~ ERROR lifetime may not live long enough
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -7,14 +7,14 @@ struct Foo<'a, 'b> {
|
||||
}
|
||||
|
||||
struct Bar<'b> {
|
||||
z: &'b u32
|
||||
z: &'b u32,
|
||||
}
|
||||
|
||||
impl Foo<'_, '_> {
|
||||
fn take_bar(&mut self, b: Bar<'_>) {
|
||||
self.y = b.z
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
fn main() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-52742.rs:15:9
|
||||
|
|
||||
LL | fn take_bar(&mut self, b: Bar<'_>) {
|
||||
|
@ -8,7 +8,7 @@ struct Foo<'s> {
|
||||
|
||||
impl Foo<'_> {
|
||||
fn new(bar: &mut Bar) -> Self {
|
||||
Foo { bar } //~ ERROR unsatisfied lifetime constraints
|
||||
Foo { bar } //~ERROR lifetime may not live long enough
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-55394.rs:11:9
|
||||
|
|
||||
LL | fn new(bar: &mut Bar) -> Self {
|
||||
| - ---- return type is Foo<'2>
|
||||
| |
|
||||
| let's call the lifetime of this reference `'1`
|
||||
LL | Foo { bar } //~ ERROR unsatisfied lifetime constraints
|
||||
LL | Foo { bar } //~ERROR lifetime may not live long enough
|
||||
| ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -5,7 +5,7 @@
|
||||
fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
|
||||
let g: fn(_, _) -> _ = |_x, y| y;
|
||||
g
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/mir_check_cast_closure.rs:7:5
|
||||
|
|
||||
LL | fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
|
||||
|
@ -35,7 +35,7 @@ fn bar<'a>(x: &'a u32) -> &'static u32 {
|
||||
// as part of checking the `ReifyFnPointer`.
|
||||
let f: fn(_) -> _ = foo;
|
||||
f(x)
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/mir_check_cast_reify.rs:37:5
|
||||
|
|
||||
LL | fn bar<'a>(x: &'a u32) -> &'static u32 {
|
||||
|
@ -7,7 +7,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;
|
||||
unsafe { g(input) }
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/mir_check_cast_unsafe_fn.rs:9:14
|
||||
|
|
||||
LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
|
||||
|
@ -6,7 +6,7 @@ use std::fmt::Debug;
|
||||
|
||||
fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
|
||||
x
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/mir_check_cast_unsize.rs:8:5
|
||||
|
|
||||
LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
|
||||
|
@ -40,7 +40,7 @@ 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: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/projection-one-region-closure.rs:45:39
|
||||
|
|
||||
LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
|
||||
@ -94,7 +94,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
|
||||
|
|
||||
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/projection-one-region-closure.rs:56:39
|
||||
|
|
||||
LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
|
||||
|
@ -31,7 +31,7 @@ LL | | }
|
||||
T
|
||||
]
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/projection-one-region-trait-bound-closure.rs:37:39
|
||||
|
|
||||
LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
|
||||
@ -76,7 +76,7 @@ LL | | }
|
||||
T
|
||||
]
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/projection-one-region-trait-bound-closure.rs:47:39
|
||||
|
|
||||
LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
|
||||
|
@ -85,7 +85,7 @@ where
|
||||
T: Anything<'b, 'b>,
|
||||
{
|
||||
with_signature(cell, t, |cell, t| require(cell, t));
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
#[rustc_regions]
|
||||
|
@ -217,7 +217,7 @@ LL | | where
|
||||
LL | | T: Anything<'b, 'b>,
|
||||
LL | | {
|
||||
LL | | with_signature(cell, t, |cell, t| require(cell, t));
|
||||
LL | | //~^ ERROR unsatisfied lifetime constraints
|
||||
LL | | //~^ ERROR lifetime may not live long enough
|
||||
LL | | }
|
||||
| |_^
|
||||
|
|
||||
@ -226,7 +226,7 @@ LL | | }
|
||||
T
|
||||
]
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/projection-two-region-trait-bound-closure.rs:87:29
|
||||
|
|
||||
LL | fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/type-alias-free-regions.rs:19:9
|
||||
|
|
||||
LL | impl<'a> FromBox<'a> for C<'a> {
|
||||
@ -8,7 +8,7 @@ LL | fn from_box(b: Box<B>) -> Self {
|
||||
LL | C { f: b } //~ ERROR
|
||||
| ^^^^^^^^^^ returning this value requires that `'1` must outlive `'a`
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/type-alias-free-regions.rs:29:9
|
||||
|
|
||||
LL | impl<'a> FromTuple<'a> for C<'a> {
|
||||
|
@ -5,21 +5,21 @@
|
||||
fn foo<'a>() {
|
||||
// Here `x` is free in the closure sig:
|
||||
|x: &'a i32| -> &'static i32 {
|
||||
return x; //~ ERROR unsatisfied lifetime constraints
|
||||
return x; //~ ERROR lifetime may not live long enough
|
||||
};
|
||||
}
|
||||
|
||||
fn foo1() {
|
||||
// Here `x` is bound in the closure sig:
|
||||
|x: &i32| -> &'static i32 {
|
||||
return x; //~ ERROR unsatisfied lifetime constraints
|
||||
return x; //~ ERROR lifetime may not live long enough
|
||||
};
|
||||
}
|
||||
|
||||
fn bar<'a>() {
|
||||
// Here `x` is free in the closure sig:
|
||||
|x: &'a i32, b: fn(&'static i32)| {
|
||||
b(x); //~ ERROR unsatisfied lifetime constraints
|
||||
b(x); //~ ERROR lifetime may not live long enough
|
||||
};
|
||||
}
|
||||
|
||||
@ -30,4 +30,4 @@ fn bar1() {
|
||||
};
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
fn main() {}
|
||||
|
@ -1,27 +1,27 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/closure-substs.rs:8:16
|
||||
|
|
||||
LL | fn foo<'a>() {
|
||||
| -- lifetime `'a` defined here
|
||||
...
|
||||
LL | return x; //~ ERROR unsatisfied lifetime constraints
|
||||
LL | return x; //~ ERROR lifetime may not live long enough
|
||||
| ^ returning this value requires that `'a` must outlive `'static`
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
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; //~ ERROR unsatisfied lifetime constraints
|
||||
LL | return x; //~ ERROR lifetime may not live long enough
|
||||
| ^ returning this value requires that `'1` must outlive `'static`
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/closure-substs.rs:22:9
|
||||
|
|
||||
LL | fn bar<'a>() {
|
||||
| -- lifetime `'a` defined here
|
||||
...
|
||||
LL | b(x); //~ ERROR unsatisfied lifetime constraints
|
||||
LL | b(x); //~ ERROR lifetime may not live long enough
|
||||
| ^^^^ argument requires that `'a` must outlive `'static`
|
||||
|
||||
error[E0521]: borrowed data escapes outside of closure
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/constant-in-expr-inherent-1.rs:10:5
|
||||
|
|
||||
LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/constant-in-expr-normalize.rs:20:5
|
||||
|
|
||||
LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/constant-in-expr-trait-item-1.rs:12:5
|
||||
|
|
||||
LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/constant-in-expr-trait-item-2.rs:12:5
|
||||
|
|
||||
LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/constant-in-expr-trait-item-3.rs:12:5
|
||||
|
|
||||
LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
|
||||
|
@ -1,8 +1,8 @@
|
||||
#![feature(nll)]
|
||||
|
||||
fn test<'a>() {
|
||||
let _:fn(&()) = |_:&'a ()| {}; //~ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
let _:fn(&()) = |_:&'a ()| {}; //~ ERROR lifetime may not live long enough
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -1,19 +1,19 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-54124.rs:4:22
|
||||
|
|
||||
LL | fn test<'a>() {
|
||||
| -- lifetime `'a` defined here
|
||||
LL | let _:fn(&()) = |_:&'a ()| {}; //~ ERROR unsatisfied lifetime constraints
|
||||
LL | let _:fn(&()) = |_:&'a ()| {}; //~ ERROR lifetime may not live long enough
|
||||
| ^ - let's call the lifetime of this reference `'1`
|
||||
| |
|
||||
| requires that `'1` must outlive `'a`
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-54124.rs:4:22
|
||||
|
|
||||
LL | fn test<'a>() {
|
||||
| -- lifetime `'a` defined here
|
||||
LL | let _:fn(&()) = |_:&'a ()| {}; //~ ERROR unsatisfied lifetime constraints
|
||||
LL | let _:fn(&()) = |_:&'a ()| {}; //~ ERROR lifetime may not live long enough
|
||||
| ^ requires that `'a` must outlive `'static`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -148,7 +148,7 @@ LL | value1: &x, //~ ERROR
|
||||
LL | }
|
||||
| - `x` dropped here while still borrowed
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/patterns.rs:113:5
|
||||
|
|
||||
LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
|
||||
@ -157,7 +157,7 @@ LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
|
||||
LL | y //~ ERROR
|
||||
| ^ returning this value requires that `'a` must outlive `'static`
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/patterns.rs:125:5
|
||||
|
|
||||
LL | fn static_to_a_to_static_through_tuple<'a>(x: &'a u32) -> &'static u32 {
|
||||
@ -166,7 +166,7 @@ LL | fn static_to_a_to_static_through_tuple<'a>(x: &'a u32) -> &'static u32 {
|
||||
LL | y //~ ERROR
|
||||
| ^ returning this value requires that `'a` must outlive `'static`
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/patterns.rs:130:5
|
||||
|
|
||||
LL | fn static_to_a_to_static_through_struct<'a>(_x: &'a u32) -> &'static u32 {
|
||||
@ -175,7 +175,7 @@ LL | let Single { value: y }: Single<&'a u32> = Single { value: &22 };
|
||||
LL | y //~ ERROR
|
||||
| ^ returning this value requires that `'a` must outlive `'static`
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/patterns.rs:134:18
|
||||
|
|
||||
LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 {
|
||||
|
@ -9,7 +9,7 @@ impl<'a, 'b> Foo<'a, 'b> {
|
||||
}
|
||||
|
||||
pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
|
||||
Foo::xmute(u) //~ ERROR unsatisfied lifetime constraints
|
||||
Foo::xmute(u) //~ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,11 +1,11 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/wf-self-type.rs:12:5
|
||||
|
|
||||
LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
|
||||
| -- -- lifetime `'b` defined here
|
||||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | Foo::xmute(u) //~ ERROR unsatisfied lifetime constraints
|
||||
LL | Foo::xmute(u) //~ ERROR lifetime may not live long enough
|
||||
| ^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -11,7 +11,7 @@ where
|
||||
|
||||
fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
|
||||
foo(x, y)
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/where_clauses_in_functions.rs:13:5
|
||||
|
|
||||
LL | fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
|
||||
|
@ -11,7 +11,7 @@ struct Foo<'a: 'b, 'b> {
|
||||
|
||||
fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
|
||||
Foo { x, y };
|
||||
//~^ ERROR unsatisfied lifetime constraints
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/where_clauses_in_structs.rs:13:11
|
||||
|
|
||||
LL | fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unsatisfied lifetime constraints
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/regions-static-bound.rs:9:5
|
||||
|
|
||||
LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
|
||||
|
@ -7,7 +7,7 @@ fn static_id_indirect<'a,'b>(t: &'a ()) -> &'static ()
|
||||
where 'a: 'b, 'b: 'static { t }
|
||||
fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
|
||||
t //[ll]~ ERROR E0312
|
||||
//[nll]~^ ERROR unsatisfied lifetime constraints
|
||||
//[nll]~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn error(u: &(), v: &()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user