1
1
error: `extern` callback uses type `[u8]`, which is not FFI-safe
2
- --> $DIR/lint-94223 .rs:4 :15
2
+ --> $DIR/ice-fnptr-slicearg .rs:7 :15
3
3
|
4
4
LL | pub fn bad(f: extern "C" fn([u8])) {}
5
5
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -8,13 +8,13 @@ LL | pub fn bad(f: extern "C" fn([u8])) {}
8
8
= help: consider using a raw pointer to the slice's first element (and a length) instead
9
9
= note: slices have no C equivalent
10
10
note: the lint level is defined here
11
- --> $DIR/lint-94223 .rs:2:36
11
+ --> $DIR/ice-fnptr-slicearg .rs:2:36
12
12
|
13
13
LL | #![deny(improper_c_fn_definitions, improper_c_callbacks)]
14
14
| ^^^^^^^^^^^^^^^^^^^^
15
15
16
16
error: `extern` callback uses type `[u8]`, which is not FFI-safe
17
- --> $DIR/lint-94223 .rs:7 :28
17
+ --> $DIR/ice-fnptr-slicearg .rs:10 :28
18
18
|
19
19
LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
20
20
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -24,7 +24,7 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
24
24
= note: slices have no C equivalent
25
25
26
26
error: `extern` callback uses type `[u8]`, which is not FFI-safe
27
- --> $DIR/lint-94223 .rs:7 :49
27
+ --> $DIR/ice-fnptr-slicearg .rs:10 :49
28
28
|
29
29
LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
30
30
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -34,7 +34,7 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
34
34
= note: slices have no C equivalent
35
35
36
36
error: `extern` callback uses type `[u8]`, which is not FFI-safe
37
- --> $DIR/lint-94223 .rs:11 :18
37
+ --> $DIR/ice-fnptr-slicearg .rs:14 :18
38
38
|
39
39
LL | struct BadStruct(extern "C" fn([u8]));
40
40
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -44,7 +44,7 @@ LL | struct BadStruct(extern "C" fn([u8]));
44
44
= note: slices have no C equivalent
45
45
46
46
error: `extern` callback uses type `[u8]`, which is not FFI-safe
47
- --> $DIR/lint-94223 .rs:15 :7
47
+ --> $DIR/ice-fnptr-slicearg .rs:18 :7
48
48
|
49
49
LL | A(extern "C" fn([u8])),
50
50
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -54,7 +54,7 @@ LL | A(extern "C" fn([u8])),
54
54
= note: slices have no C equivalent
55
55
56
56
error: `extern` callback uses type `[u8]`, which is not FFI-safe
57
- --> $DIR/lint-94223 .rs:20 :7
57
+ --> $DIR/ice-fnptr-slicearg .rs:23 :7
58
58
|
59
59
LL | A(extern "C" fn([u8])),
60
60
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -64,7 +64,7 @@ LL | A(extern "C" fn([u8])),
64
64
= note: slices have no C equivalent
65
65
66
66
error: `extern` callback uses type `[u8]`, which is not FFI-safe
67
- --> $DIR/lint-94223 .rs:24 :12
67
+ --> $DIR/ice-fnptr-slicearg .rs:27 :12
68
68
|
69
69
LL | type Foo = extern "C" fn([u8]);
70
70
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -74,7 +74,7 @@ LL | type Foo = extern "C" fn([u8]);
74
74
= note: slices have no C equivalent
75
75
76
76
error: `extern` callback uses type `Option<&<T as FooTrait>::FooType>`, which is not FFI-safe
77
- --> $DIR/lint-94223 .rs:31 :20
77
+ --> $DIR/ice-fnptr-slicearg .rs:34 :20
78
78
|
79
79
LL | pub type Foo2<T> = extern "C" fn(Option<&<T as FooTrait>::FooType>);
80
80
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -84,7 +84,7 @@ LL | pub type Foo2<T> = extern "C" fn(Option<&<T as FooTrait>::FooType>);
84
84
= note: enum has no representation hint
85
85
86
86
error: `extern` callback uses type `FfiUnsafe`, which is not FFI-safe
87
- --> $DIR/lint-94223 .rs:41 :17
87
+ --> $DIR/ice-fnptr-slicearg .rs:44 :17
88
88
|
89
89
LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
90
90
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -93,13 +93,13 @@ LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
93
93
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
94
94
= note: `FfiUnsafe` has unspecified layout
95
95
note: the type is defined here
96
- --> $DIR/lint-94223 .rs:34 :1
96
+ --> $DIR/ice-fnptr-slicearg .rs:37 :1
97
97
|
98
98
LL | pub struct FfiUnsafe;
99
99
| ^^^^^^^^^^^^^^^^^^^^
100
100
101
101
error: `extern` callback uses type `FfiUnsafe`, which is not FFI-safe
102
- --> $DIR/lint-94223 .rs:44 :30
102
+ --> $DIR/ice-fnptr-slicearg .rs:47 :30
103
103
|
104
104
LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
105
105
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -108,13 +108,13 @@ LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUns
108
108
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
109
109
= note: `FfiUnsafe` has unspecified layout
110
110
note: the type is defined here
111
- --> $DIR/lint-94223 .rs:34 :1
111
+ --> $DIR/ice-fnptr-slicearg .rs:37 :1
112
112
|
113
113
LL | pub struct FfiUnsafe;
114
114
| ^^^^^^^^^^^^^^^^^^^^
115
115
116
116
error: `extern` callback uses type `FfiUnsafe`, which is not FFI-safe
117
- --> $DIR/lint-94223 .rs:44 :56
117
+ --> $DIR/ice-fnptr-slicearg .rs:47 :56
118
118
|
119
119
LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
120
120
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -123,13 +123,13 @@ LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUns
123
123
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
124
124
= note: `FfiUnsafe` has unspecified layout
125
125
note: the type is defined here
126
- --> $DIR/lint-94223 .rs:34 :1
126
+ --> $DIR/ice-fnptr-slicearg .rs:37 :1
127
127
|
128
128
LL | pub struct FfiUnsafe;
129
129
| ^^^^^^^^^^^^^^^^^^^^
130
130
131
131
error: `extern` callback uses type `FfiUnsafe`, which is not FFI-safe
132
- --> $DIR/lint-94223 .rs:48 :22
132
+ --> $DIR/ice-fnptr-slicearg .rs:51 :22
133
133
|
134
134
LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
135
135
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -138,7 +138,7 @@ LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
138
138
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
139
139
= note: `FfiUnsafe` has unspecified layout
140
140
note: the type is defined here
141
- --> $DIR/lint-94223 .rs:34 :1
141
+ --> $DIR/ice-fnptr-slicearg .rs:37 :1
142
142
|
143
143
LL | pub struct FfiUnsafe;
144
144
| ^^^^^^^^^^^^^^^^^^^^
0 commit comments