summary refs log tree commit diff
path: root/src/test/ui/c-variadic/variadic-ffi-4.stderr
blob: 65623501569e1099957f6ab89dece3c21b925b39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:8:5
   |
LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
   |                                     --            -- has type `core::ffi::VaListImpl<'1>`
   |                                     |
   |                                     lifetime `'f` defined here
LL |     ap
   |     ^^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'f`

error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:8:5
   |
LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
   |                                     --            -- has type `core::ffi::VaListImpl<'1>`
   |                                     |
   |                                     lifetime `'f` defined here
LL |     ap
   |     ^^ returning this value requires that `'1` must outlive `'f`

error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:14:5
   |
LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> {
   |                                               -- has type `core::ffi::VaListImpl<'1>`
LL |     ap
   |     ^^ returning this value requires that `'1` must outlive `'static`

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`
   |                           | |
   |                           | return type of closure is core::ffi::VaList<'2, '_>
   |                           has type `core::ffi::VaList<'1, '_>`

error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:22:5
   |
LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
   |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
   |                                               |
   |                                               has type `&mut core::ffi::VaListImpl<'1>`
LL |     *ap0 = ap1;
   |     ^^^^ assignment requires that `'1` must outlive `'2`

error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:22:5
   |
LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
   |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
   |                                               |
   |                                               has type `&mut core::ffi::VaListImpl<'1>`
LL |     *ap0 = ap1;
   |     ^^^^ assignment requires that `'2` must outlive `'1`

error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:28:5
   |
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
   |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
   |                                               |
   |                                               has type `&mut core::ffi::VaListImpl<'1>`
LL |     ap0 = &mut ap1;
   |     ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`

error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:28:5
   |
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
   |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
   |                                               |
   |                                               has type `&mut core::ffi::VaListImpl<'1>`
LL |     ap0 = &mut ap1;
   |     ^^^^^^^^^^^^^^ assignment requires that `'2` must outlive `'1`

error[E0597]: `ap1` does not live long enough
  --> $DIR/variadic-ffi-4.rs:28:11
   |
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
   |                                                        - let's call the lifetime of this reference `'3`
LL |     ap0 = &mut ap1;
   |     ------^^^^^^^^
   |     |     |
   |     |     borrowed value does not live long enough
   |     assignment requires that `ap1` is borrowed for `'3`
...
LL | }
   | - `ap1` dropped here while still borrowed

error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:35:12
   |
LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
   |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
   |                                               |
   |                                               has type `&mut core::ffi::VaListImpl<'1>`
LL |     *ap0 = ap1.clone();
   |            ^^^^^^^^^^^ argument requires that `'1` must outlive `'2`

error: lifetime may not live long enough
  --> $DIR/variadic-ffi-4.rs:35:12
   |
LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
   |                                               -------                   ------- has type `core::ffi::VaListImpl<'2>`
   |                                               |
   |                                               has type `&mut core::ffi::VaListImpl<'1>`
LL |     *ap0 = ap1.clone();
   |            ^^^^^^^^^^^ argument requires that `'2` must outlive `'1`

error: aborting due to 11 previous errors

For more information about this error, try `rustc --explain E0597`.