error[E0308]: mismatched types --> $DIR/variadic-ffi-4.rs:8:5 | LL | ap | ^^ lifetime mismatch | = note: expected struct `core::ffi::VaListImpl<'f>` found struct `core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 7:78... --> $DIR/variadic-ffi-4.rs:7:78 | LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> { | ______________________________________________________________________________^ LL | | ap LL | | } | |_^ note: ...does not necessarily outlive the lifetime `'f` as defined on the function body at 7:37 --> $DIR/variadic-ffi-4.rs:7:37 | LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> { | ^^ error[E0308]: mismatched types --> $DIR/variadic-ffi-4.rs:12:5 | LL | ap | ^^ lifetime mismatch | = note: expected struct `core::ffi::VaListImpl<'static>` found struct `core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 11:79... --> $DIR/variadic-ffi-4.rs:11:79 | LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> { | _______________________________________________________________________________^ LL | | ap LL | | } | |_^ = note: ...does not necessarily outlive the static lifetime error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/variadic-ffi-4.rs:16:33 | LL | let _ = ap.with_copy(|ap| { ap }); | ^^ | note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 16:26... --> $DIR/variadic-ffi-4.rs:16:26 | LL | let _ = ap.with_copy(|ap| { ap }); | ^^^^^^^^^^^ note: ...so that the expression is assignable --> $DIR/variadic-ffi-4.rs:16:33 | LL | let _ = ap.with_copy(|ap| { ap }); | ^^ = note: expected `core::ffi::VaList<'_, '_>` found `core::ffi::VaList<'_, '_>` note: but, the lifetime must be valid for the method call at 16:13... --> $DIR/variadic-ffi-4.rs:16:13 | LL | let _ = ap.with_copy(|ap| { ap }); | ^^^^^^^^^^^^^^^^^^^^^^^^^ note: ...so type `core::ffi::VaList<'_, '_>` of expression is valid during the expression --> $DIR/variadic-ffi-4.rs:16:13 | LL | let _ = ap.with_copy(|ap| { ap }); | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/variadic-ffi-4.rs:20:12 | LL | *ap0 = ap1; | ^^^ lifetime mismatch | = note: expected struct `core::ffi::VaListImpl<'_>` found struct `core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 19:87... --> $DIR/variadic-ffi-4.rs:19:87 | LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) { | _______________________________________________________________________________________^ LL | | *ap0 = ap1; LL | | } | |_^ note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 19:1 --> $DIR/variadic-ffi-4.rs:19:1 | LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) { LL | | *ap0 = ap1; LL | | } | |_^ error[E0490]: a value of type `core::ffi::VaListImpl<'_>` is borrowed for too long --> $DIR/variadic-ffi-4.rs:24:11 | LL | ap0 = &mut ap1; | ^^^^^^^^ | note: the type is valid for the anonymous lifetime #1 defined on the function body at 23:1 --> $DIR/variadic-ffi-4.rs:23:1 | LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) { LL | | ap0 = &mut ap1; LL | | LL | | LL | | LL | | } | |_^ note: but the borrow lasts for the scope of call-site for function at 23:83 --> $DIR/variadic-ffi-4.rs:23:83 | LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) { | ___________________________________________________________________________________^ LL | | ap0 = &mut ap1; LL | | LL | | LL | | LL | | } | |_^ error[E0308]: mismatched types --> $DIR/variadic-ffi-4.rs:24:11 | LL | ap0 = &mut ap1; | ^^^^^^^^ lifetime mismatch | = note: expected mutable reference `&mut core::ffi::VaListImpl<'_>` found mutable reference `&mut core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 23:83... --> $DIR/variadic-ffi-4.rs:23:83 | LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) { | ___________________________________________________________________________________^ LL | | ap0 = &mut ap1; LL | | LL | | LL | | LL | | } | |_^ note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 23:1 --> $DIR/variadic-ffi-4.rs:23:1 | LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) { LL | | ap0 = &mut ap1; LL | | LL | | LL | | LL | | } | |_^ error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements --> $DIR/variadic-ffi-4.rs:24:11 | LL | ap0 = &mut ap1; | ^^^^^^^^ | note: first, the lifetime cannot outlive the scope of call-site for function at 23:83... --> $DIR/variadic-ffi-4.rs:23:83 | LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) { | ___________________________________________________________________________________^ LL | | ap0 = &mut ap1; LL | | LL | | LL | | LL | | } | |_^ note: ...so that the type `core::ffi::VaListImpl<'_>` is not borrowed for too long --> $DIR/variadic-ffi-4.rs:24:11 | LL | ap0 = &mut ap1; | ^^^^^^^^ note: but, the lifetime must be valid for the anonymous lifetime #1 defined on the function body at 23:1... --> $DIR/variadic-ffi-4.rs:23:1 | LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) { LL | | ap0 = &mut ap1; LL | | LL | | LL | | LL | | } | |_^ note: ...so that reference does not outlive borrowed content --> $DIR/variadic-ffi-4.rs:24:11 | LL | ap0 = &mut ap1; | ^^^^^^^^ error[E0308]: mismatched types --> $DIR/variadic-ffi-4.rs:31:12 | LL | *ap0 = ap1.clone(); | ^^^^^^^^^^^ lifetime mismatch | = note: expected struct `core::ffi::VaListImpl<'_>` found struct `core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 30:87... --> $DIR/variadic-ffi-4.rs:30:87 | LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) { | _______________________________________________________________________________________^ LL | | *ap0 = ap1.clone(); LL | | } | |_^ note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 30:1 --> $DIR/variadic-ffi-4.rs:30:1 | LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) { LL | | *ap0 = ap1.clone(); LL | | } | |_^ error: aborting due to 8 previous errors Some errors have detailed explanations: E0308, E0495. For more information about an error, try `rustc --explain E0308`.