fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
5.3 KiB111 linesraw
1error[E0621]: explicit lifetime required in the type of `ap`
2  --> $DIR/variadic-ffi-4.rs:8:5
3   |
4LL | 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>`
6LL |     ap
7   |     ^^ lifetime `'f` required
8
9error[E0621]: explicit lifetime required in the type of `ap`
10  --> $DIR/variadic-ffi-4.rs:12:5
11   |
12LL | 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>`
14LL |     ap
15   |     ^^ lifetime `'static` required
16
17error: lifetime may not live long enough
18  --> $DIR/variadic-ffi-4.rs:16:33
19   |
20LL |     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
26error: lifetime may not live long enough
27  --> $DIR/variadic-ffi-4.rs:20:5
28   |
29LL | 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>`
33LL |     *ap0 = ap1;
34   |     ^^^^ assignment requires that `'1` must outlive `'2`
35
36error: lifetime may not live long enough
37  --> $DIR/variadic-ffi-4.rs:20:5
38   |
39LL | 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>`
43LL |     *ap0 = ap1;
44   |     ^^^^ assignment requires that `'2` must outlive `'1`
45
46error: lifetime may not live long enough
47  --> $DIR/variadic-ffi-4.rs:25:5
48   |
49LL | 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>`
53LL |     ap0 = &mut ap1;
54   |     ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
55
56error: lifetime may not live long enough
57  --> $DIR/variadic-ffi-4.rs:25:5
58   |
59LL | 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>`
63LL |     ap0 = &mut ap1;
64   |     ^^^^^^^^^^^^^^ assignment requires that `'2` must outlive `'1`
65
66error[E0384]: cannot assign to immutable argument `ap0`
67  --> $DIR/variadic-ffi-4.rs:25:5
68   |
69LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
70   |                                               --- help: make this binding mutable: `mut ap0`
71LL |     ap0 = &mut ap1;
72   |     ^^^^^^^^^^^^^^ cannot assign to immutable argument
73
74error[E0597]: `ap1` does not live long enough
75  --> $DIR/variadic-ffi-4.rs:25:11
76   |
77LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
78   |                                                    - let's call the lifetime of this reference `'1`
79LL |     ap0 = &mut ap1;
80   |     ------^^^^^^^^
81   |     |     |
82   |     |     borrowed value does not live long enough
83   |     assignment requires that `ap1` is borrowed for `'1`
84...
85LL | }
86   | - `ap1` dropped here while still borrowed
87
88error: lifetime may not live long enough
89  --> $DIR/variadic-ffi-4.rs:33:12
90   |
91LL | 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>`
95LL |     *ap0 = ap1.clone();
96   |            ^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
97
98error: lifetime may not live long enough
99  --> $DIR/variadic-ffi-4.rs:33:12
100   |
101LL | 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>`
105LL |     *ap0 = ap1.clone();
106   |            ^^^^^^^^^^^ argument requires that `'2` must outlive `'1`
107
108error: aborting due to 11 previous errors
109
110Some errors have detailed explanations: E0384, E0597, E0621.
111For more information about an error, try `rustc --explain E0384`.