// | '_#4r | Local | ['_#4r]
// |
// | Inferred Region Values
-// | '_#0r | U0 | {bb0[0..=1], '_#0r}
+// | '_#0r | U0 | {bb0[0..=1], '_#0r, '_#1r, '_#2r, '_#3r, '_#4r}
// | '_#1r | U0 | {bb0[0..=1], '_#1r}
// | '_#2r | U0 | {bb0[0..=1], '_#2r}
// | '_#3r | U0 | {bb0[0..=1], '_#3r}
LL | bar(foo, x) //[transmute]~ ERROR E0495
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
-error: aborting due to previous error
+error: unsatisfied lifetime constraints
+ --> $DIR/project-fn-ret-contravariant.rs:48:4
+ |
+LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | bar(foo, x) //[transmute]~ ERROR E0495
+ | ^^^^^^^^^^^ requires that `'a` must outlive `'b`
+
+error: aborting due to 2 previous errors
LL | bar(foo, x) //[transmute]~ ERROR E0495
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
-error: aborting due to previous error
+error: unsatisfied lifetime constraints
+ --> $DIR/project-fn-ret-invariant.rs:58:13
+ |
+LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+...
+LL | bar(foo, x) //[transmute]~ ERROR E0495
+ | ^ requires that `'a` must outlive `'b`
+
+error: aborting due to 2 previous errors
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
| - let's call the lifetime of this reference `'1`
LL | self.x.iter().map(|a| a.0)
- | ^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
+ | ^^^^^^ cast requires that `'1` must outlive `'static`
error: unsatisfied lifetime constraints
--> $DIR/static-return-lifetime-infered.rs:21:9
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
| -- lifetime `'a` defined here
LL | self.x.iter().map(|a| a.0)
- | ^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+ | ^^^^^^ cast requires that `'a` must outlive `'static`
error: aborting due to 2 previous errors
#[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
+ //~^ ERROR borrowed data escapes outside of function
+ //~| ERROR unsatisfied lifetime constraints
// Only works if 'x: 'y:
demand_y(x, y, x.get())
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| _______________________________________________^
-LL | | //~^ ERROR
+LL | | //~^ ERROR borrowed data escapes outside of function
+LL | | //~| ERROR unsatisfied lifetime constraints
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
|
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
-LL | |
+LL | | //~^ ERROR borrowed data escapes outside of function
+LL | | //~| ERROR unsatisfied lifetime constraints
... |
LL | | });
LL | | }
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
| ------ `cell_a` is a reference that is only valid in the function body
LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-LL | | //~^ ERROR
+LL | | //~^ ERROR borrowed data escapes outside of function
+LL | | //~| ERROR unsatisfied lifetime constraints
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | });
| |______^ `cell_a` escapes the function body here
-error: aborting due to previous error
+error: unsatisfied lifetime constraints
+ --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:29
+ |
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
+ | ^^^^^^^ requires that `'a` must outlive `'b`
+
+error: aborting due to 2 previous errors
#[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
+ //~^ ERROR borrowed data escapes outside of function
+ //~| ERROR unsatisfied lifetime constraints
// Only works if 'x: 'y:
demand_y(x, y, x.get())
});
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| _______________________________________________^
-LL | | //~^ ERROR
+LL | | //~^ ERROR borrowed data escapes outside of function
+LL | | //~| ERROR unsatisfied lifetime constraints
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | });
|
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
-LL | | // Only works if 'x: 'y:
-LL | | demand_y(x, y, x.get())
+LL | | //~^ ERROR borrowed data escapes outside of function
+LL | | //~| ERROR unsatisfied lifetime constraints
+... |
LL | | });
LL | | }
| |_^
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
| ------ `cell_a` is a reference that is only valid in the function body
LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | | //~^ ERROR
+LL | | //~^ ERROR borrowed data escapes outside of function
+LL | | //~| ERROR unsatisfied lifetime constraints
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | });
| |______^ `cell_a` escapes the function body here
-error: aborting due to previous error
+error: unsatisfied lifetime constraints
+ --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:29
+ |
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
+ | ^^^^^^^ requires that `'a` must outlive `'b`
+
+error: aborting due to 2 previous errors
i32,
extern "rust-call" fn((T,))
]
- = note: number of external vids: 3
+ = note: number of external vids: 2
= note: where T: '_#1r
note: No external requirements
// The MIR type checker must therefore relate `'?0` to `'?1` and `'?2`
// as part of checking the `ReifyFnPointer`.
let f: fn(_) -> _ = foo;
+ //~^ ERROR unsatisfied lifetime constraints
f(x)
- //~^ ERROR
}
fn main() {}
error: unsatisfied lifetime constraints
- --> $DIR/mir_check_cast_reify.rs:47:5
+ --> $DIR/mir_check_cast_reify.rs:46:25
|
LL | fn bar<'a>(x: &'a u32) -> &'static u32 {
| -- lifetime `'a` defined here
...
-LL | f(x)
- | ^^^^ returning this value requires that `'a` must outlive `'static`
+LL | let f: fn(_) -> _ = foo;
+ | ^^^ cast requires that `'a` must outlive `'static`
error: aborting due to previous error
// Here the NLL checker must relate the types in `f` to the types
// in `g`. These are related via the `UnsafeFnPointer` cast.
let g: unsafe fn(_) -> _ = f;
+ //~^ ERROR unsatisfied lifetime constraints
unsafe { g(input) }
- //~^ ERROR
}
fn main() {}
error: unsatisfied lifetime constraints
- --> $DIR/mir_check_cast_unsafe_fn.rs:19:14
+ --> $DIR/mir_check_cast_unsafe_fn.rs:18:32
|
LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
| -- lifetime `'a` defined here
...
-LL | unsafe { g(input) }
- | ^^^^^^^^ returning this value requires that `'a` must outlive `'static`
+LL | let g: unsafe fn(_) -> _ = f;
+ | ^ cast requires that `'a` must outlive `'static`
error: aborting due to previous error
LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
| -- lifetime `'a` defined here
LL | x
- | ^ returning this value requires that `'a` must outlive `'static`
+ | ^ cast requires that `'a` must outlive `'static`
error: aborting due to previous error
i32,
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>
]
- = note: number of external vids: 4
+ = note: number of external vids: 3
= note: where <T as std::iter::Iterator>::Item: '_#2r
note: No external requirements
i32,
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>
]
- = note: number of external vids: 4
+ = note: number of external vids: 3
= note: where <T as std::iter::Iterator>::Item: '_#2r
note: No external requirements
i32,
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where <T as std::iter::Iterator>::Item: '_#3r
note: No external requirements
i32,
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where <T as std::iter::Iterator>::Item: '_#3r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where T: '_#2r
= note: where '_#1r: '_#2r
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where T: '_#3r
= note: where '_#2r: '_#3r
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where T: '_#3r
= note: where '_#2r: '_#3r
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where T: '_#3r
= note: where '_#2r: '_#3r
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where '_#1r: '_#2r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where '_#2r: '_#3r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where '_#2r: '_#3r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where '_#2r: '_#3r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
]
- = note: number of external vids: 4
+ = note: number of external vids: 3
= note: where '_#1r: '_#2r
note: No external requirements
T: Anything<'b, 'c>,
{
with_signature(cell, t, |cell, t| require(cell, t));
- //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
+ //~^ ERROR associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
}
#[rustc_regions]
'a: 'a,
{
with_signature(cell, t, |cell, t| require(cell, t));
- //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+ //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
}
#[rustc_regions]
// can do better here with a more involved verification step.
with_signature(cell, t, |cell, t| require(cell, t));
- //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+ //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
}
#[rustc_regions]
T: Anything<'b, 'b>,
{
with_signature(cell, t, |cell, t| require(cell, t));
- //~^ ERROR
+ //~^ ERROR unsatisfied lifetime constraints
}
#[rustc_regions]
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 6
+ = note: number of external vids: 5
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r
note: No external requirements
LL | | T: Anything<'b, 'c>,
LL | | {
LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
+LL | | //~^ ERROR associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
LL | | }
| |_^
|
T
]
-error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
+error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:48:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
+ = help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
note: External requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:58:29
i32,
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
]
- = note: number of external vids: 6
+ = note: number of external vids: 5
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
note: No external requirements
LL | | T: Anything<'b, 'c>,
LL | | 'a: 'a,
... |
-LL | | //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+LL | | //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
LL | | }
| |_^
|
T
]
-error[E0309]: the associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:58:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: consider adding an explicit lifetime bound `<T as Anything<'_#7r, '_#8r>>::AssocType: ReEarlyBound(0, 'a)`...
+ = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
note: External requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:78:29
i32,
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
]
- = note: number of external vids: 6
+ = note: number of external vids: 5
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
note: No external requirements
LL | | T: Anything<'b, 'c>,
LL | | T::AssocType: 'a,
... |
-LL | | //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+LL | | //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
LL | | }
| |_^
|
T
]
-error[E0309]: the associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
--> $DIR/projection-two-region-trait-bound-closure.rs:78:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: consider adding an explicit lifetime bound `<T as Anything<'_#7r, '_#8r>>::AssocType: ReEarlyBound(0, 'a)`...
+ = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
note: External requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:88:29
i32,
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
]
- = note: number of external vids: 6
+ = note: number of external vids: 5
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
]
- = note: number of external vids: 6
+ = note: number of external vids: 5
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
note: No external requirements
LL | | T: Anything<'b, 'b>,
LL | | {
LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | //~^ ERROR
+LL | | //~^ ERROR unsatisfied lifetime constraints
LL | | }
| |_^
|
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#2r)>>::AssocType: '_#3r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
]
- = note: number of external vids: 4
+ = note: number of external vids: 3
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
note: No external requirements
i16,
for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
]
- = note: number of external vids: 3
+ = note: number of external vids: 2
= note: where T: '_#1r
note: No external requirements
i16,
for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
]
- = note: number of external vids: 4
+ = note: number of external vids: 3
= note: where T: '_#1r
note: No external requirements
i32,
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>
]
- = note: number of external vids: 4
+ = note: number of external vids: 3
= note: where T: '_#2r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T))
]
- = note: number of external vids: 4
+ = note: number of external vids: 3
= note: where T: '_#1r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
]
- = note: number of external vids: 4
+ = note: number of external vids: 3
= note: where T: '_#2r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where T: '_#2r
note: No external requirements
i32,
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
]
- = note: number of external vids: 5
+ = note: number of external vids: 4
= note: where T: '_#3r
note: No external requirements
error: unsatisfied lifetime constraints
- --> $DIR/regions-addr-of-self.rs:17:37
+ --> $DIR/regions-addr-of-self.rs:17:13
|
LL | pub fn chase_cat(&mut self) {
| - let's call the lifetime of this reference `'1`
LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer
- | ^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
+ | ^ requires that `'1` must outlive `'static`
error: aborting due to previous error
error: unsatisfied lifetime constraints
- --> $DIR/regions-addr-of-upvar-self.rs:20:41
+ --> $DIR/regions-addr-of-upvar-self.rs:20:17
|
LL | let _f = || {
| -- lifetime `'1` represents this closure's body
LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
- | ^^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
+ | ^ requires that `'1` must outlive `'static`
+ |
+ = note: closure implements `FnMut`, so references to captured variables can't escape the closure
+
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-addr-of-upvar-self.rs:20:17
+ |
+LL | pub fn chase_cat(&mut self) {
+ | --------- lifetime `'2` appears in the type of `self`
+LL | let _f = || {
+ | -- lifetime `'1` represents this closure's body
+LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
+ | ^ requires that `'1` must outlive `'2`
|
= note: closure implements `FnMut`, so references to captured variables can't escape the closure
|
= note: borrowed value must be valid for the static lifetime...
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0597`.
error: unsatisfied lifetime constraints
- --> $DIR/regions-close-object-into-object-2.rs:20:5
+ --> $DIR/regions-close-object-into-object-2.rs:20:11
|
LL | fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> {
| -- lifetime `'a` defined here
LL | box B(&*v) as Box<X> //~ ERROR cannot infer
- | ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
+ | ^^^ cast requires that `'a` must outlive `'static`
error[E0597]: `*v` does not live long enough
--> $DIR/regions-close-object-into-object-2.rs:20:11
|
= help: consider adding an explicit lifetime bound `U: 'static`...
-error: unsatisfied lifetime constraints
- --> $DIR/regions-close-object-into-object-4.rs:20:5
- |
-LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {
- | -- lifetime `'a` defined here
-LL | box B(&*v) as Box<X> //~ ERROR cannot infer
- | ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
-
error[E0310]: the parameter type `U` may not live long enough
--> $DIR/regions-close-object-into-object-4.rs:20:9
|
|
= help: consider adding an explicit lifetime bound `U: 'static`...
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-close-object-into-object-4.rs:20:11
+ |
+LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {
+ | -- lifetime `'a` defined here
+LL | box B(&*v) as Box<X> //~ ERROR cannot infer
+ | ^^^ cast requires that `'a` must outlive `'static`
+
error[E0597]: `*v` does not live long enough
--> $DIR/regions-close-object-into-object-4.rs:20:11
|
| ^^^^^^^^^^^^^ lifetime `'static` required
error[E0621]: explicit lifetime required in the type of `v`
- --> $DIR/regions-static-bound.rs:26:5
+ --> $DIR/regions-static-bound.rs:27:5
|
LL | fn error(u: &(), v: &()) {
| --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
| ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
-error: aborting due to 3 previous errors
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-static-bound.rs:24:5
+ |
+LL | fn error(u: &(), v: &()) {
+ | - - let's call the lifetime of this reference `'2`
+ | |
+ | let's call the lifetime of this reference `'1`
+LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
+ | ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-static-bound.rs:27:5
+ |
+LL | fn error(u: &(), v: &()) {
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
+...
+LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
+ | ^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0621`.
| ^^^^^^^^^ lifetime `'static` required
error[E0621]: explicit lifetime required in the type of `v`
- --> $DIR/regions-static-bound.rs:26:5
+ --> $DIR/regions-static-bound.rs:27:5
|
LL | fn error(u: &(), v: &()) {
| --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
| ^^^^^^^^^^^^^ lifetime `'static` required
error[E0621]: explicit lifetime required in the type of `v`
- --> $DIR/regions-static-bound.rs:26:5
+ --> $DIR/regions-static-bound.rs:27:5
|
LL | fn error(u: &(), v: &()) {
| --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
| ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
-error: aborting due to 3 previous errors
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-static-bound.rs:24:5
+ |
+LL | fn error(u: &(), v: &()) {
+ | - - let's call the lifetime of this reference `'2`
+ | |
+ | let's call the lifetime of this reference `'1`
+LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
+ | ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-static-bound.rs:27:5
+ |
+LL | fn error(u: &(), v: &()) {
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
+...
+LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
+ | ^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0621`.
fn error(u: &(), v: &()) {
static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
//[nll]~^ ERROR explicit lifetime required in the type of `u` [E0621]
+ //[nll]~| ERROR unsatisfied lifetime constraints
static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
//[nll]~^ ERROR explicit lifetime required in the type of `v` [E0621]
+ //[nll]~| ERROR unsatisfied lifetime constraints
}
fn main() {}
| - let's call the lifetime of this reference `'1`
LL | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
- | ^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
+ | ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`
error: aborting due to previous error