11error: `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
33 |
44LL | pub fn bad(f: extern "C" fn([u8])) {}
55 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -8,13 +8,13 @@ LL | pub fn bad(f: extern "C" fn([u8])) {}
88 = help: consider using a raw pointer to the slice's first element (and a length) instead
99 = note: slices have no C equivalent
1010note: the lint level is defined here
11- --> $DIR/lint-94223 .rs:2:36
11+ --> $DIR/ice-fnptr-slicearg .rs:2:36
1212 |
1313LL | #![deny(improper_c_fn_definitions, improper_c_callbacks)]
1414 | ^^^^^^^^^^^^^^^^^^^^
1515
1616error: `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
1818 |
1919LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
2020 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -24,7 +24,7 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
2424 = note: slices have no C equivalent
2525
2626error: `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
2828 |
2929LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
3030 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -34,7 +34,7 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
3434 = note: slices have no C equivalent
3535
3636error: `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
3838 |
3939LL | struct BadStruct(extern "C" fn([u8]));
4040 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -44,7 +44,7 @@ LL | struct BadStruct(extern "C" fn([u8]));
4444 = note: slices have no C equivalent
4545
4646error: `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
4848 |
4949LL | A(extern "C" fn([u8])),
5050 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -54,7 +54,7 @@ LL | A(extern "C" fn([u8])),
5454 = note: slices have no C equivalent
5555
5656error: `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
5858 |
5959LL | A(extern "C" fn([u8])),
6060 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -64,7 +64,7 @@ LL | A(extern "C" fn([u8])),
6464 = note: slices have no C equivalent
6565
6666error: `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
6868 |
6969LL | type Foo = extern "C" fn([u8]);
7070 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -74,7 +74,7 @@ LL | type Foo = extern "C" fn([u8]);
7474 = note: slices have no C equivalent
7575
7676error: `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
7878 |
7979LL | pub type Foo2<T> = extern "C" fn(Option<&<T as FooTrait>::FooType>);
8080 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -84,7 +84,7 @@ LL | pub type Foo2<T> = extern "C" fn(Option<&<T as FooTrait>::FooType>);
8484 = note: enum has no representation hint
8585
8686error: `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
8888 |
8989LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
9090 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -93,13 +93,13 @@ LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
9393 = help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
9494 = note: `FfiUnsafe` has unspecified layout
9595note: the type is defined here
96- --> $DIR/lint-94223 .rs:34 :1
96+ --> $DIR/ice-fnptr-slicearg .rs:37 :1
9797 |
9898LL | pub struct FfiUnsafe;
9999 | ^^^^^^^^^^^^^^^^^^^^
100100
101101error: `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
103103 |
104104LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
105105 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -108,13 +108,13 @@ LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUns
108108 = help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
109109 = note: `FfiUnsafe` has unspecified layout
110110note: the type is defined here
111- --> $DIR/lint-94223 .rs:34 :1
111+ --> $DIR/ice-fnptr-slicearg .rs:37 :1
112112 |
113113LL | pub struct FfiUnsafe;
114114 | ^^^^^^^^^^^^^^^^^^^^
115115
116116error: `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
118118 |
119119LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
120120 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -123,13 +123,13 @@ LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUns
123123 = help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
124124 = note: `FfiUnsafe` has unspecified layout
125125note: the type is defined here
126- --> $DIR/lint-94223 .rs:34 :1
126+ --> $DIR/ice-fnptr-slicearg .rs:37 :1
127127 |
128128LL | pub struct FfiUnsafe;
129129 | ^^^^^^^^^^^^^^^^^^^^
130130
131131error: `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
133133 |
134134LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
135135 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -138,7 +138,7 @@ LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
138138 = help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
139139 = note: `FfiUnsafe` has unspecified layout
140140note: the type is defined here
141- --> $DIR/lint-94223 .rs:34 :1
141+ --> $DIR/ice-fnptr-slicearg .rs:37 :1
142142 |
143143LL | pub struct FfiUnsafe;
144144 | ^^^^^^^^^^^^^^^^^^^^
0 commit comments