2020-05-20 12:58:41 -05:00
|
|
|
error: lifetime may not live long enough
|
2018-11-30 09:53:44 -06:00
|
|
|
--> $DIR/variadic-ffi-4.rs:8:5
|
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
|
2020-09-02 02:40:56 -05:00
|
|
|
| -- -- has type `VaListImpl<'1>`
|
2020-05-20 12:58:41 -05:00
|
|
|
| |
|
|
|
|
| lifetime `'f` defined here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | ap
|
2020-05-20 12:58:41 -05:00
|
|
|
| ^^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'f`
|
2021-09-27 20:22:44 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2020-05-20 12:58:41 -05:00
|
|
|
|
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:8:5
|
2019-08-10 06:38:17 -05:00
|
|
|
|
|
|
|
|
LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
|
2020-09-02 02:40:56 -05:00
|
|
|
| -- -- has type `VaListImpl<'1>`
|
2020-05-20 12:58:41 -05:00
|
|
|
| |
|
|
|
|
| lifetime `'f` defined here
|
|
|
|
LL | ap
|
2021-12-31 15:55:34 -06:00
|
|
|
| ^^ function was supposed to return data with lifetime `'f` but it is returning data with lifetime `'1`
|
2021-09-27 20:22:44 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2018-11-30 09:53:44 -06:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:14:5
|
2018-11-30 09:53:44 -06:00
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> {
|
2020-09-02 02:40:56 -05:00
|
|
|
| -- has type `VaListImpl<'1>`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | ap
|
2020-05-20 12:58:41 -05:00
|
|
|
| ^^ returning this value requires that `'1` must outlive `'static`
|
2021-09-27 20:22:44 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2018-11-30 09:53:44 -06:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:18:31
|
|
|
|
|
|
|
|
|
LL | let _ = ap.with_copy(|ap| ap);
|
|
|
|
| --- ^^ returning this value requires that `'1` must outlive `'2`
|
|
|
|
| | |
|
2020-09-02 02:40:56 -05:00
|
|
|
| | return type of closure is VaList<'2, '_>
|
|
|
|
| has type `VaList<'1, '_>`
|
2018-11-30 09:53:44 -06:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:22:5
|
2018-11-30 09:53:44 -06:00
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ------- ------- has type `VaListImpl<'2>`
|
2020-05-20 12:58:41 -05:00
|
|
|
| |
|
2020-09-02 02:40:56 -05:00
|
|
|
| has type `&mut VaListImpl<'1>`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | *ap0 = ap1;
|
2020-05-20 12:58:41 -05:00
|
|
|
| ^^^^ assignment requires that `'1` must outlive `'2`
|
2021-09-27 20:22:44 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2018-11-30 09:53:44 -06:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:22:5
|
2018-11-30 09:53:44 -06:00
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ------- ------- has type `VaListImpl<'2>`
|
2020-05-20 12:58:41 -05:00
|
|
|
| |
|
2020-09-02 02:40:56 -05:00
|
|
|
| has type `&mut VaListImpl<'1>`
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | *ap0 = ap1;
|
|
|
|
| ^^^^ assignment requires that `'2` must outlive `'1`
|
2021-09-27 20:22:44 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2018-11-30 09:53:44 -06:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:28:5
|
2018-11-30 09:53:44 -06:00
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ------- ------- has type `VaListImpl<'2>`
|
2020-05-20 12:58:41 -05:00
|
|
|
| |
|
2020-09-02 02:40:56 -05:00
|
|
|
| has type `&mut VaListImpl<'1>`
|
2018-11-30 09:53:44 -06:00
|
|
|
LL | ap0 = &mut ap1;
|
2020-05-20 12:58:41 -05:00
|
|
|
| ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
|
2021-05-13 08:30:14 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of a mutable reference to `VaListImpl<'_>`
|
2021-05-13 08:30:14 -05:00
|
|
|
= note: mutable references are invariant over their type parameter
|
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2018-11-30 09:53:44 -06:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:28:5
|
2018-11-30 09:53:44 -06:00
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ------- ------- has type `VaListImpl<'2>`
|
2020-05-20 12:58:41 -05:00
|
|
|
| |
|
2020-09-02 02:40:56 -05:00
|
|
|
| has type `&mut VaListImpl<'1>`
|
2018-11-30 09:53:44 -06:00
|
|
|
LL | ap0 = &mut ap1;
|
2020-05-20 12:58:41 -05:00
|
|
|
| ^^^^^^^^^^^^^^ assignment requires that `'2` must outlive `'1`
|
2021-05-13 08:30:14 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of a mutable reference to `VaListImpl<'_>`
|
2021-05-13 08:30:14 -05:00
|
|
|
= note: mutable references are invariant over their type parameter
|
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2020-05-20 12:58:41 -05:00
|
|
|
|
|
|
|
error[E0597]: `ap1` does not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:28:11
|
2018-11-30 09:53:44 -06:00
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
|
2023-01-14 21:06:44 -06:00
|
|
|
| - ------- binding `ap1` declared here
|
|
|
|
| |
|
|
|
|
| let's call the lifetime of this reference `'3`
|
2018-11-30 09:53:44 -06:00
|
|
|
LL | ap0 = &mut ap1;
|
2020-05-20 12:58:41 -05:00
|
|
|
| ------^^^^^^^^
|
|
|
|
| | |
|
|
|
|
| | borrowed value does not live long enough
|
|
|
|
| assignment requires that `ap1` is borrowed for `'3`
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - `ap1` dropped here while still borrowed
|
2018-11-30 09:53:44 -06:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:35:12
|
2019-03-25 16:28:03 -05:00
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ------- ------- has type `VaListImpl<'2>`
|
2020-05-20 12:58:41 -05:00
|
|
|
| |
|
2020-09-02 02:40:56 -05:00
|
|
|
| has type `&mut VaListImpl<'1>`
|
2019-03-25 16:28:03 -05:00
|
|
|
LL | *ap0 = ap1.clone();
|
2020-05-20 12:58:41 -05:00
|
|
|
| ^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
|
2021-09-27 20:22:44 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2020-05-20 12:58:41 -05:00
|
|
|
|
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/variadic-ffi-4.rs:35:12
|
2019-03-25 16:28:03 -05:00
|
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ------- ------- has type `VaListImpl<'2>`
|
2020-05-20 12:58:41 -05:00
|
|
|
| |
|
2020-09-02 02:40:56 -05:00
|
|
|
| has type `&mut VaListImpl<'1>`
|
2020-05-20 12:58:41 -05:00
|
|
|
LL | *ap0 = ap1.clone();
|
|
|
|
| ^^^^^^^^^^^ argument requires that `'2` must outlive `'1`
|
2021-09-27 20:22:44 -05:00
|
|
|
|
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2019-03-25 16:28:03 -05:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
error: aborting due to 11 previous errors
|
2018-11-30 09:53:44 -06:00
|
|
|
|
2020-05-20 12:58:41 -05:00
|
|
|
For more information about this error, try `rustc --explain E0597`.
|