File tree 2 files changed +33
-1
lines changed
2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ extern {
65
65
pub fn transparent_i128 ( p : TransparentI128 ) ; //~ ERROR: uses type `i128`
66
66
pub fn transparent_str ( p : TransparentStr ) ; //~ ERROR: uses type `str`
67
67
pub fn transparent_fn ( p : TransparentBadFn ) ; //~ ERROR: uses type `std::boxed::Box<u32>`
68
+ pub fn raw_array ( arr : [ u8 ; 8 ] ) ; //~ ERROR: uses type `[u8; 8]`
69
+
70
+ pub static static_u128_type: u128 ; //~ ERROR: uses type `u128`
71
+ pub static static_u128_array_type: [ u128 ; 16 ] ; //~ ERROR: uses type `u128`
68
72
69
73
pub fn good3 ( fptr : Option < extern fn ( ) > ) ;
70
74
pub fn good4 ( aptr : & [ u8 ; 4 as usize ] ) ;
@@ -83,6 +87,9 @@ extern {
83
87
pub fn good17 ( p : TransparentCustomZst ) ;
84
88
#[ allow( improper_ctypes) ]
85
89
pub fn good18 ( _: & String ) ;
90
+ pub fn good20 ( arr : * const [ u8 ; 8 ] ) ;
91
+ pub static good21: [ u8 ; 8 ] ;
92
+
86
93
}
87
94
88
95
#[ allow( improper_ctypes) ]
Original file line number Diff line number Diff line change @@ -197,5 +197,30 @@ LL | pub fn transparent_fn(p: TransparentBadFn);
197
197
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
198
198
= note: this struct has unspecified layout
199
199
200
- error: aborting due to 20 previous errors
200
+ error: `extern` block uses type `[u8; 8]`, which is not FFI-safe
201
+ --> $DIR/lint-ctypes.rs:68:27
202
+ |
203
+ LL | pub fn raw_array(arr: [u8; 8]);
204
+ | ^^^^^^^ not FFI-safe
205
+ |
206
+ = help: consider passing a pointer to the array
207
+ = note: passing raw arrays by value is not FFI-safe
208
+
209
+ error: `extern` block uses type `u128`, which is not FFI-safe
210
+ --> $DIR/lint-ctypes.rs:70:34
211
+ |
212
+ LL | pub static static_u128_type: u128;
213
+ | ^^^^ not FFI-safe
214
+ |
215
+ = note: 128-bit integers don't currently have a known stable ABI
216
+
217
+ error: `extern` block uses type `u128`, which is not FFI-safe
218
+ --> $DIR/lint-ctypes.rs:71:40
219
+ |
220
+ LL | pub static static_u128_array_type: [u128; 16];
221
+ | ^^^^^^^^^^ not FFI-safe
222
+ |
223
+ = note: 128-bit integers don't currently have a known stable ABI
224
+
225
+ error: aborting due to 23 previous errors
201
226
You can’t perform that action at this time.
0 commit comments