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