@@ -4,7 +4,7 @@ error: `extern` callback uses type `[u8]`, which is not FFI-safe
44LL | pub fn bad(f: extern "C" fn([u8])) {}
55 | ^^^^ not FFI-safe
66 |
7- = help: consider using a raw pointer instead
7+ = help: consider using a raw pointer to the slice's first element (and a length) instead
88 = note: slices have no C equivalent
99note: the lint level is defined here
1010 --> $DIR/lint-94223.rs:2:38
@@ -18,7 +18,7 @@ error: `extern` callback uses type `[u8]`, which is not FFI-safe
1818LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
1919 | ^^^^ not FFI-safe
2020 |
21- = help: consider using a raw pointer instead
21+ = help: consider using a raw pointer to the slice's first element (and a length) instead
2222 = note: slices have no C equivalent
2323
2424error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -27,7 +27,7 @@ error: `extern` callback uses type `[u8]`, which is not FFI-safe
2727LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
2828 | ^^^^ not FFI-safe
2929 |
30- = help: consider using a raw pointer instead
30+ = help: consider using a raw pointer to the slice's first element (and a length) instead
3131 = note: slices have no C equivalent
3232
3333error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -36,7 +36,7 @@ error: `extern` callback uses type `[u8]`, which is not FFI-safe
3636LL | struct BadStruct(extern "C" fn([u8]));
3737 | ^^^^ not FFI-safe
3838 |
39- = help: consider using a raw pointer instead
39+ = help: consider using a raw pointer to the slice's first element (and a length) instead
4040 = note: slices have no C equivalent
4141
4242error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -45,7 +45,7 @@ error: `extern` callback uses type `[u8]`, which is not FFI-safe
4545LL | A(extern "C" fn([u8])),
4646 | ^^^^ not FFI-safe
4747 |
48- = help: consider using a raw pointer instead
48+ = help: consider using a raw pointer to the slice's first element (and a length) instead
4949 = note: slices have no C equivalent
5050
5151error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -54,7 +54,7 @@ error: `extern` callback uses type `[u8]`, which is not FFI-safe
5454LL | A(extern "C" fn([u8])),
5555 | ^^^^ not FFI-safe
5656 |
57- = help: consider using a raw pointer instead
57+ = help: consider using a raw pointer to the slice's first element (and a length) instead
5858 = note: slices have no C equivalent
5959
6060error: `extern` callback uses type `[u8]`, which is not FFI-safe
@@ -63,7 +63,7 @@ error: `extern` callback uses type `[u8]`, which is not FFI-safe
6363LL | type Foo = extern "C" fn([u8]);
6464 | ^^^^ not FFI-safe
6565 |
66- = help: consider using a raw pointer instead
66+ = help: consider using a raw pointer to the slice's first element (and a length) instead
6767 = note: slices have no C equivalent
6868
6969error: `extern` callback uses type `Option<&<T as FooTrait>::FooType>`, which is not FFI-safe
0 commit comments