]> git.lizzy.rs Git - rust.git/blob - src/test/ui/c-variadic/variadic-ffi-4.stderr
Update tests
[rust.git] / src / test / ui / c-variadic / variadic-ffi-4.stderr
1 error: lifetime may not live long enough
2   --> $DIR/variadic-ffi-4.rs:8:5
3    |
4 LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
5    |                                     --            -- has type `core::ffi::VaListImpl<'1>`
6    |                                     |
7    |                                     lifetime `'f` defined here
8 LL |     ap
9    |     ^^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'f`
10
11 error: lifetime may not live long enough
12   --> $DIR/variadic-ffi-4.rs:8:5
13    |
14 LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
15    |                                     --            -- has type `core::ffi::VaListImpl<'1>`
16    |                                     |
17    |                                     lifetime `'f` defined here
18 LL |     ap
19    |     ^^ returning this value requires that `'1` must outlive `'f`
20
21 error: lifetime may not live long enough
22   --> $DIR/variadic-ffi-4.rs:14:5
23    |
24 LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> {
25    |                                               -- has type `core::ffi::VaListImpl<'1>`
26 LL |     ap
27    |     ^^ returning this value requires that `'1` must outlive `'static`
28
29 error: lifetime may not live long enough
30   --> $DIR/variadic-ffi-4.rs:18:31
31    |
32 LL |     let _ = ap.with_copy(|ap| ap);
33    |                           --- ^^ returning this value requires that `'1` must outlive `'2`
34    |                           | |
35    |                           | return type of closure is core::ffi::VaList<'2, '_>
36    |                           has type `core::ffi::VaList<'1, '_>`
37
38 error: lifetime may not live long enough
39   --> $DIR/variadic-ffi-4.rs:22:5
40    |
41 LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
42    |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
43    |                                               |
44    |                                               has type `&mut core::ffi::VaListImpl<'1>`
45 LL |     *ap0 = ap1;
46    |     ^^^^ assignment requires that `'1` must outlive `'2`
47
48 error: lifetime may not live long enough
49   --> $DIR/variadic-ffi-4.rs:22:5
50    |
51 LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
52    |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
53    |                                               |
54    |                                               has type `&mut core::ffi::VaListImpl<'1>`
55 LL |     *ap0 = ap1;
56    |     ^^^^ assignment requires that `'2` must outlive `'1`
57
58 error: lifetime may not live long enough
59   --> $DIR/variadic-ffi-4.rs:28:5
60    |
61 LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
62    |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
63    |                                               |
64    |                                               has type `&mut core::ffi::VaListImpl<'1>`
65 LL |     ap0 = &mut ap1;
66    |     ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
67
68 error: lifetime may not live long enough
69   --> $DIR/variadic-ffi-4.rs:28:5
70    |
71 LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
72    |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
73    |                                               |
74    |                                               has type `&mut core::ffi::VaListImpl<'1>`
75 LL |     ap0 = &mut ap1;
76    |     ^^^^^^^^^^^^^^ assignment requires that `'2` must outlive `'1`
77
78 error[E0597]: `ap1` does not live long enough
79   --> $DIR/variadic-ffi-4.rs:28:11
80    |
81 LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
82    |                                                        - let's call the lifetime of this reference `'3`
83 LL |     ap0 = &mut ap1;
84    |     ------^^^^^^^^
85    |     |     |
86    |     |     borrowed value does not live long enough
87    |     assignment requires that `ap1` is borrowed for `'3`
88 ...
89 LL | }
90    | - `ap1` dropped here while still borrowed
91
92 error: lifetime may not live long enough
93   --> $DIR/variadic-ffi-4.rs:35:12
94    |
95 LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
96    |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
97    |                                               |
98    |                                               has type `&mut core::ffi::VaListImpl<'1>`
99 LL |     *ap0 = ap1.clone();
100    |            ^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
101
102 error: lifetime may not live long enough
103   --> $DIR/variadic-ffi-4.rs:35:12
104    |
105 LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
106    |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
107    |                                               |
108    |                                               has type `&mut core::ffi::VaListImpl<'1>`
109 LL |     *ap0 = ap1.clone();
110    |            ^^^^^^^^^^^ argument requires that `'2` must outlive `'1`
111
112 error: aborting due to 11 previous errors
113
114 For more information about this error, try `rustc --explain E0597`.