11error: `extern` block uses type `Foo`, which is not FFI-safe
2- --> $DIR/lint-ctypes.rs:47 :28
2+ --> $DIR/lint-ctypes.rs:60 :28
33 |
44LL | pub fn ptr_type1(size: *const Foo);
55 | ^^^^^^^^^^ not FFI-safe
@@ -8,18 +8,18 @@ LL | pub fn ptr_type1(size: *const Foo);
88 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
99 = note: this struct has unspecified layout
1010note: the type is defined here
11- --> $DIR/lint-ctypes.rs:25 :1
11+ --> $DIR/lint-ctypes.rs:28 :1
1212 |
1313LL | pub struct Foo;
1414 | ^^^^^^^^^^^^^^
1515note: the lint level is defined here
16- --> $DIR/lint-ctypes.rs:4 :9
16+ --> $DIR/lint-ctypes.rs:5 :9
1717 |
1818LL | #![deny(improper_ctypes)]
1919 | ^^^^^^^^^^^^^^^
2020
2121error: `extern` block uses type `Foo`, which is not FFI-safe
22- --> $DIR/lint-ctypes.rs:48 :28
22+ --> $DIR/lint-ctypes.rs:61 :28
2323 |
2424LL | pub fn ptr_type2(size: *const Foo);
2525 | ^^^^^^^^^^ not FFI-safe
@@ -28,13 +28,13 @@ LL | pub fn ptr_type2(size: *const Foo);
2828 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
2929 = note: this struct has unspecified layout
3030note: the type is defined here
31- --> $DIR/lint-ctypes.rs:25 :1
31+ --> $DIR/lint-ctypes.rs:28 :1
3232 |
3333LL | pub struct Foo;
3434 | ^^^^^^^^^^^^^^
3535
3636error: `extern` block uses type `((),)`, which is not FFI-safe
37- --> $DIR/lint-ctypes.rs:50 :25
37+ --> $DIR/lint-ctypes.rs:63 :25
3838 |
3939LL | pub fn ptr_tuple(p: *const ((),));
4040 | ^^^^^^^^^^^^ not FFI-safe
@@ -44,7 +44,7 @@ LL | pub fn ptr_tuple(p: *const ((),));
4444 = note: tuples have unspecified layout
4545
4646error: `extern` block uses type `&[u32]`, which is not FFI-safe
47- --> $DIR/lint-ctypes.rs:51 :26
47+ --> $DIR/lint-ctypes.rs:64 :26
4848 |
4949LL | pub fn slice_type(p: &[u32]);
5050 | ^^^^^^ not FFI-safe
@@ -53,7 +53,7 @@ LL | pub fn slice_type(p: &[u32]);
5353 = note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
5454
5555error: `extern` block uses type `&str`, which is not FFI-safe
56- --> $DIR/lint-ctypes.rs:52 :24
56+ --> $DIR/lint-ctypes.rs:65 :24
5757 |
5858LL | pub fn str_type(p: &str);
5959 | ^^^^ not FFI-safe
@@ -71,7 +71,7 @@ LL | pub fn box_type(p: Box<u32>);
7171 = note: this struct has unspecified layout
7272
7373error: `extern` block uses type `Option<Box<u32>>`, which is not FFI-safe
74- --> $DIR/lint-ctypes.rs:54 :28
74+ --> $DIR/lint-ctypes.rs:67 :28
7575 |
7676LL | pub fn opt_box_type(p: Option<Box<u32>>);
7777 | ^^^^^^^^^^^^^^^^ not FFI-safe
@@ -80,7 +80,7 @@ LL | pub fn opt_box_type(p: Option<Box<u32>>);
8080 = note: enum has no representation hint
8181
8282error: `extern` block uses type `char`, which is not FFI-safe
83- --> $DIR/lint-ctypes.rs:56 :25
83+ --> $DIR/lint-ctypes.rs:69 :25
8484 |
8585LL | pub fn char_type(p: char);
8686 | ^^^^ not FFI-safe
@@ -89,31 +89,31 @@ LL | pub fn char_type(p: char);
8989 = note: the `char` type has no C equivalent
9090
9191error: `extern` block uses type `i128`, which is not FFI-safe
92- --> $DIR/lint-ctypes.rs:57 :25
92+ --> $DIR/lint-ctypes.rs:70 :25
9393 |
9494LL | pub fn i128_type(p: i128);
9595 | ^^^^ not FFI-safe
9696 |
9797 = note: 128-bit integers don't currently have a known stable ABI
9898
9999error: `extern` block uses type `u128`, which is not FFI-safe
100- --> $DIR/lint-ctypes.rs:58 :25
100+ --> $DIR/lint-ctypes.rs:71 :25
101101 |
102102LL | pub fn u128_type(p: u128);
103103 | ^^^^ not FFI-safe
104104 |
105105 = note: 128-bit integers don't currently have a known stable ABI
106106
107107error: `extern` block uses type `&dyn Bar`, which is not FFI-safe
108- --> $DIR/lint-ctypes.rs:59 :26
108+ --> $DIR/lint-ctypes.rs:72 :26
109109 |
110110LL | pub fn trait_type(p: &dyn Bar);
111111 | ^^^^^^^^ not FFI-safe
112112 |
113113 = note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
114114
115115error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
116- --> $DIR/lint-ctypes.rs:60 :26
116+ --> $DIR/lint-ctypes.rs:73 :26
117117 |
118118LL | pub fn tuple_type(p: (i32, i32));
119119 | ^^^^^^^^^^ not FFI-safe
@@ -122,7 +122,7 @@ LL | pub fn tuple_type(p: (i32, i32));
122122 = note: tuples have unspecified layout
123123
124124error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
125- --> $DIR/lint-ctypes.rs:61 :27
125+ --> $DIR/lint-ctypes.rs:74 :27
126126 |
127127LL | pub fn tuple_type2(p: I32Pair);
128128 | ^^^^^^^ not FFI-safe
@@ -131,42 +131,42 @@ LL | pub fn tuple_type2(p: I32Pair);
131131 = note: tuples have unspecified layout
132132
133133error: `extern` block uses type `ZeroSize`, which is not FFI-safe
134- --> $DIR/lint-ctypes.rs:62 :25
134+ --> $DIR/lint-ctypes.rs:75 :25
135135 |
136136LL | pub fn zero_size(p: ZeroSize);
137137 | ^^^^^^^^ not FFI-safe
138138 |
139139 = help: consider adding a member to this struct
140140 = note: this struct has no fields
141141note: the type is defined here
142- --> $DIR/lint-ctypes.rs:21 :1
142+ --> $DIR/lint-ctypes.rs:24 :1
143143 |
144144LL | pub struct ZeroSize;
145145 | ^^^^^^^^^^^^^^^^^^^
146146
147147error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
148- --> $DIR/lint-ctypes.rs:63 :33
148+ --> $DIR/lint-ctypes.rs:76 :33
149149 |
150150LL | pub fn zero_size_phantom(p: ZeroSizeWithPhantomData);
151151 | ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
152152 |
153153 = note: composed only of `PhantomData`
154154note: the type is defined here
155- --> $DIR/lint-ctypes.rs:44 :1
155+ --> $DIR/lint-ctypes.rs:57 :1
156156 |
157157LL | pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData<i32>);
158158 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159159
160160error: `extern` block uses type `PhantomData<bool>`, which is not FFI-safe
161- --> $DIR/lint-ctypes.rs:66 :12
161+ --> $DIR/lint-ctypes.rs:79 :12
162162 |
163163LL | -> ::std::marker::PhantomData<bool>;
164164 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
165165 |
166166 = note: composed only of `PhantomData`
167167
168168error: `extern` block uses type `fn()`, which is not FFI-safe
169- --> $DIR/lint-ctypes.rs:67 :23
169+ --> $DIR/lint-ctypes.rs:80 :23
170170 |
171171LL | pub fn fn_type(p: RustFn);
172172 | ^^^^^^ not FFI-safe
@@ -175,7 +175,7 @@ LL | pub fn fn_type(p: RustFn);
175175 = note: this function pointer has Rust-specific calling convention
176176
177177error: `extern` block uses type `fn()`, which is not FFI-safe
178- --> $DIR/lint-ctypes.rs:68 :24
178+ --> $DIR/lint-ctypes.rs:81 :24
179179 |
180180LL | pub fn fn_type2(p: fn());
181181 | ^^^^ not FFI-safe
@@ -193,15 +193,15 @@ LL | pub fn fn_contained(p: RustBadRet);
193193 = note: this struct has unspecified layout
194194
195195error: `extern` block uses type `i128`, which is not FFI-safe
196- --> $DIR/lint-ctypes.rs:70 :32
196+ --> $DIR/lint-ctypes.rs:83 :32
197197 |
198198LL | pub fn transparent_i128(p: TransparentI128);
199199 | ^^^^^^^^^^^^^^^ not FFI-safe
200200 |
201201 = note: 128-bit integers don't currently have a known stable ABI
202202
203203error: `extern` block uses type `&str`, which is not FFI-safe
204- --> $DIR/lint-ctypes.rs:71 :31
204+ --> $DIR/lint-ctypes.rs:84 :31
205205 |
206206LL | pub fn transparent_str(p: TransparentStr);
207207 | ^^^^^^^^^^^^^^ not FFI-safe
@@ -219,16 +219,24 @@ LL | pub fn transparent_fn(p: TransparentBadFn);
219219 = note: this struct has unspecified layout
220220
221221error: `extern` block uses type `[u8; 8]`, which is not FFI-safe
222- --> $DIR/lint-ctypes.rs:73 :27
222+ --> $DIR/lint-ctypes.rs:86 :27
223223 |
224224LL | pub fn raw_array(arr: [u8; 8]);
225225 | ^^^^^^^ not FFI-safe
226226 |
227227 = help: consider passing a pointer to the array
228228 = note: passing raw arrays by value is not FFI-safe
229229
230+ error: `extern` block uses type `&UnsizedStructBecauseDyn`, which is not FFI-safe
231+ --> $DIR/lint-ctypes.rs:89:47
232+ |
233+ LL | pub fn struct_unsized_ptr_has_metadata(p: &UnsizedStructBecauseDyn);
234+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
235+ |
236+ = note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
237+
230238error: `extern` block uses type `Option<UnsafeCell<extern "C" fn()>>`, which is not FFI-safe
231- --> $DIR/lint-ctypes.rs:75 :26
239+ --> $DIR/lint-ctypes.rs:91 :26
232240 |
233241LL | pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>);
234242 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -237,7 +245,7 @@ LL | pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>);
237245 = note: enum has no representation hint
238246
239247error: `extern` block uses type `Option<UnsafeCell<&i32>>`, which is not FFI-safe
240- --> $DIR/lint-ctypes.rs:77 :26
248+ --> $DIR/lint-ctypes.rs:93 :26
241249 |
242250LL | pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
243251 | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -246,19 +254,19 @@ LL | pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
246254 = note: enum has no representation hint
247255
248256error: `extern` block uses type `u128`, which is not FFI-safe
249- --> $DIR/lint-ctypes.rs:80 :34
257+ --> $DIR/lint-ctypes.rs:96 :34
250258 |
251259LL | pub static static_u128_type: u128;
252260 | ^^^^ not FFI-safe
253261 |
254262 = note: 128-bit integers don't currently have a known stable ABI
255263
256264error: `extern` block uses type `u128`, which is not FFI-safe
257- --> $DIR/lint-ctypes.rs:81 :40
265+ --> $DIR/lint-ctypes.rs:97 :40
258266 |
259267LL | pub static static_u128_array_type: [u128; 16];
260268 | ^^^^^^^^^^ not FFI-safe
261269 |
262270 = note: 128-bit integers don't currently have a known stable ABI
263271
264- error: aborting due to 27 previous errors
272+ error: aborting due to 29 previous errors
0 commit comments