@@ -66,61 +66,70 @@ LL | type Foo = extern "C" fn([u8]);
66
66
= help: consider using a raw pointer instead
67
67
= note: slices have no C equivalent
68
68
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
+
69
78
error: `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
71
80
|
72
81
LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
73
82
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
74
83
|
75
84
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
76
85
= note: this struct has unspecified layout
77
86
note: the type is defined here
78
- --> $DIR/lint-ctypes-94223.rs:27 :1
87
+ --> $DIR/lint-ctypes-94223.rs:34 :1
79
88
|
80
89
LL | pub struct FfiUnsafe;
81
90
| ^^^^^^^^^^^^^^^^^^^^
82
91
83
92
error: `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
85
94
|
86
95
LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
87
96
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
88
97
|
89
98
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
90
99
= note: this struct has unspecified layout
91
100
note: the type is defined here
92
- --> $DIR/lint-ctypes-94223.rs:27 :1
101
+ --> $DIR/lint-ctypes-94223.rs:34 :1
93
102
|
94
103
LL | pub struct FfiUnsafe;
95
104
| ^^^^^^^^^^^^^^^^^^^^
96
105
97
106
error: `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
99
108
|
100
109
LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
101
110
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
102
111
|
103
112
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
104
113
= note: this struct has unspecified layout
105
114
note: the type is defined here
106
- --> $DIR/lint-ctypes-94223.rs:27 :1
115
+ --> $DIR/lint-ctypes-94223.rs:34 :1
107
116
|
108
117
LL | pub struct FfiUnsafe;
109
118
| ^^^^^^^^^^^^^^^^^^^^
110
119
111
120
error: `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
113
122
|
114
123
LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
115
124
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
116
125
|
117
126
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
118
127
= note: this struct has unspecified layout
119
128
note: the type is defined here
120
- --> $DIR/lint-ctypes-94223.rs:27 :1
129
+ --> $DIR/lint-ctypes-94223.rs:34 :1
121
130
|
122
131
LL | pub struct FfiUnsafe;
123
132
| ^^^^^^^^^^^^^^^^^^^^
124
133
125
- error: aborting due to 11 previous errors
134
+ error: aborting due to 12 previous errors
126
135
0 commit comments