@@ -5,7 +5,7 @@ LL | pub fn bad(f: extern "C" fn([u8])) {}
55 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
66 |
77 = note: the function pointer to `extern "C" fn([u8])` is FFI-unsafe due to `[u8]`
8- = help: consider using a raw pointer instead
8+ = 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
1111 --> $DIR/lint-94223.rs:2:36
@@ -20,7 +20,7 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
2020 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
2121 |
2222 = note: the function pointer to `extern "C" fn([u8])` is FFI-unsafe due to `[u8]`
23- = help: consider using a raw pointer instead
23+ = help: consider using a raw pointer to the slice's first element (and a length) instead
2424 = note: slices have no C equivalent
2525
2626error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -30,7 +30,7 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
3030 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
3131 |
3232 = note: the function pointer to `extern "C" fn([u8])` is FFI-unsafe due to `[u8]`
33- = help: consider using a raw pointer instead
33+ = help: consider using a raw pointer to the slice's first element (and a length) instead
3434 = note: slices have no C equivalent
3535
3636error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -40,7 +40,7 @@ LL | struct BadStruct(extern "C" fn([u8]));
4040 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
4141 |
4242 = note: the function pointer to `extern "C" fn([u8])` is FFI-unsafe due to `[u8]`
43- = help: consider using a raw pointer instead
43+ = help: consider using a raw pointer to the slice's first element (and a length) instead
4444 = note: slices have no C equivalent
4545
4646error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -50,7 +50,7 @@ LL | A(extern "C" fn([u8])),
5050 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
5151 |
5252 = note: the function pointer to `extern "C" fn([u8])` is FFI-unsafe due to `[u8]`
53- = help: consider using a raw pointer instead
53+ = help: consider using a raw pointer to the slice's first element (and a length) instead
5454 = note: slices have no C equivalent
5555
5656error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -60,7 +60,7 @@ LL | A(extern "C" fn([u8])),
6060 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
6161 |
6262 = note: the function pointer to `extern "C" fn([u8])` is FFI-unsafe due to `[u8]`
63- = help: consider using a raw pointer instead
63+ = help: consider using a raw pointer to the slice's first element (and a length) instead
6464 = note: slices have no C equivalent
6565
6666error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -70,7 +70,7 @@ LL | type Foo = extern "C" fn([u8]);
7070 | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
7171 |
7272 = note: the function pointer to `extern "C" fn([u8])` is FFI-unsafe due to `[u8]`
73- = help: consider using a raw pointer instead
73+ = help: consider using a raw pointer to the slice's first element (and a length) instead
7474 = note: slices have no C equivalent
7575
7676error: `extern` callback uses type `Option<&<T as FooTrait>::FooType>`, which is not FFI-safe
0 commit comments