bless test output

This commit is contained in:
Niko Matsakis 2019-06-17 11:38:38 -04:00
parent adba6a8f90
commit 5d44bebb32
2 changed files with 3 additions and 6 deletions

View File

@ -8,9 +8,9 @@ struct CopyIfEq<T, U>(T, U);
impl<T: Copy> Copy for CopyIfEq<T, T> {}
existential type E<'a, 'b>: Sized;
//~^ ERROR lifetime may not live long enough
fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
//~^ ERROR lifetime may not live long enough
let v = CopyIfEq::<*mut _, *mut _>(&mut {x}, &mut y);
let u = v;
let _: *mut &'a i32 = u.1;

View File

@ -1,11 +1,8 @@
error: lifetime may not live long enough
--> $DIR/error-handling.rs:10:1
--> $DIR/error-handling.rs:12:56
|
LL | existential type E<'a, 'b>: Sized;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
...
LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
| -- lifetime `'a` defined here
| -- lifetime `'a` defined here ^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint
|
LL | existential type E<'a, 'b>: Sized; + 'a