summary refs log tree commit diff
path: root/src/test/ui/c-variadic/variadic-ffi-4.stderr
blob: 311e2173702c8ae0a0375faeb2ff48fb4f062f7d (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
error[E0621]: explicit lifetime required in the type of `ap`
  --> $DIR/variadic-ffi-4.rs:8:5
   |
LL | pub unsafe extern "C" fn no_escape0<'a>(_: usize, ap: ...) -> VaList<'a> {
   |                                                       --- help: add explicit lifetime `'a` to the type of `ap`: `core::ffi::VaList<'a>`
LL |     ap
   |     ^^ lifetime `'a` required

error[E0621]: explicit lifetime required in the type of `ap`
  --> $DIR/variadic-ffi-4.rs:12:5
   |
LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaList<'static> {
   |                                                   --- help: add explicit lifetime `'static` to the type of `ap`: `core::ffi::VaList<'static>`
LL |     ap
   |     ^^ lifetime `'static` required

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:
           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 type `core::ffi::VaList<'_>`
              found type `core::ffi::VaList<'_>`
note: the anonymous lifetime #3 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 VaList, 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 VaList, mut ap1: ...) {
LL | |     *ap0 = ap1;
LL | | }
   | |_^

error[E0490]: a value of type `core::ffi::VaList<'_>` 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 VaList, mut ap1: ...) {
LL | |     ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | |
LL | | }
   | |_^
note: but the borrow lasts for the anonymous lifetime #3 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 VaList, mut ap1: ...) {
LL | |     ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | |
LL | | }
   | |_^

error[E0308]: mismatched types
  --> $DIR/variadic-ffi-4.rs:24:11
   |
LL |     ap0 = &mut ap1;
   |           ^^^^^^^^ lifetime mismatch
   |
   = note: expected type `&mut core::ffi::VaList<'_>`
              found type `&mut core::ffi::VaList<'_>`
note: the anonymous lifetime #3 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 VaList, mut ap1: ...) {
LL | |     ap0 = &mut ap1;
LL | |
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 VaList, mut ap1: ...) {
LL | |     ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | |
LL | | }
   | |_^

error[E0308]: mismatched types
  --> $DIR/variadic-ffi-4.rs:24:11
   |
LL |     ap0 = &mut ap1;
   |           ^^^^^^^^ lifetime mismatch
   |
   = note: expected type `&mut core::ffi::VaList<'_>`
              found type `&mut core::ffi::VaList<'_>`
note: 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 VaList, mut ap1: ...) {
LL | |     ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | |
LL | | }
   | |_^
note: ...does not necessarily outlive the anonymous lifetime #3 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 VaList, mut ap1: ...) {
LL | |     ap0 = &mut ap1;
LL | |
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 anonymous lifetime #3 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 VaList, mut ap1: ...) {
LL | |     ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | |
LL | | }
   | |_^
note: ...so that the type `core::ffi::VaList<'_>` 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 VaList, mut ap1: ...) {
LL | |     ap0 = &mut ap1;
LL | |
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: aborting due to 8 previous errors

Some errors occurred: E0308, E0490, E0495, E0621.
For more information about an error, try `rustc --explain E0308`.