@@ -66,61 +66,70 @@ LL | type Foo = extern "C" fn([u8]);
6666 = help: consider using a raw pointer instead
6767 = note: slices have no C equivalent
6868
69+ error: `extern` fn uses type `Option<&<T as FooTrait>::FooType>`, which is not FFI-safe
70+ --> $DIR/lint-ctypes-94223.rs:31:20
71+ |
72+ LL | pub type Foo2<T> = extern "C" fn(Option<&<T as FooTrait>::FooType>);
73+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
74+ |
75+ = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
76+ = note: enum has no representation hint
77+
6978error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
70- --> $DIR/lint-ctypes-94223.rs:34 :17
79+ --> $DIR/lint-ctypes-94223.rs:41 :17
7180 |
7281LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
7382 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
7483 |
7584 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
7685 = note: this struct has unspecified layout
7786note: the type is defined here
78- --> $DIR/lint-ctypes-94223.rs:27 :1
87+ --> $DIR/lint-ctypes-94223.rs:34 :1
7988 |
8089LL | pub struct FfiUnsafe;
8190 | ^^^^^^^^^^^^^^^^^^^^
8291
8392error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
84- --> $DIR/lint-ctypes-94223.rs:37 :30
93+ --> $DIR/lint-ctypes-94223.rs:44 :30
8594 |
8695LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
8796 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
8897 |
8998 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
9099 = note: this struct has unspecified layout
91100note: the type is defined here
92- --> $DIR/lint-ctypes-94223.rs:27 :1
101+ --> $DIR/lint-ctypes-94223.rs:34 :1
93102 |
94103LL | pub struct FfiUnsafe;
95104 | ^^^^^^^^^^^^^^^^^^^^
96105
97106error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
98- --> $DIR/lint-ctypes-94223.rs:37 :56
107+ --> $DIR/lint-ctypes-94223.rs:44 :56
99108 |
100109LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
101110 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
102111 |
103112 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
104113 = note: this struct has unspecified layout
105114note: the type is defined here
106- --> $DIR/lint-ctypes-94223.rs:27 :1
115+ --> $DIR/lint-ctypes-94223.rs:34 :1
107116 |
108117LL | pub struct FfiUnsafe;
109118 | ^^^^^^^^^^^^^^^^^^^^
110119
111120error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
112- --> $DIR/lint-ctypes-94223.rs:41 :22
121+ --> $DIR/lint-ctypes-94223.rs:48 :22
113122 |
114123LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
115124 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
116125 |
117126 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
118127 = note: this struct has unspecified layout
119128note: the type is defined here
120- --> $DIR/lint-ctypes-94223.rs:27 :1
129+ --> $DIR/lint-ctypes-94223.rs:34 :1
121130 |
122131LL | pub struct FfiUnsafe;
123132 | ^^^^^^^^^^^^^^^^^^^^
124133
125- error: aborting due to 11 previous errors
134+ error: aborting due to 12 previous errors
126135
0 commit comments