@@ -30,14 +30,15 @@ use pin_utils::unsafe_pinned;
30
30
use std:: {
31
31
convert:: TryFrom ,
32
32
fmt:: { self , Debug } ,
33
- io:: { IoSlice , IoSliceMut } ,
34
33
marker:: { PhantomData , PhantomPinned } ,
35
34
mem,
36
35
os:: unix:: io:: RawFd ,
37
36
pin:: Pin ,
38
37
ptr,
39
38
thread
40
39
} ;
40
+ #[ cfg( target_os = "freebsd" ) ]
41
+ use std:: io:: { IoSlice , IoSliceMut } ;
41
42
use crate :: sys:: signal:: * ;
42
43
use crate :: sys:: time:: TimeSpec ;
43
44
@@ -1185,16 +1186,24 @@ mod t {
1185
1186
assert_eq ! ( aior. as_ref( ) as * const libc:: aiocb,
1186
1187
& aior as * const AioRead as * const libc:: aiocb) ;
1187
1188
1189
+ let wbuf = [ ] ;
1190
+ let aiow = AioWrite :: new ( 666 , 0 , & wbuf, 0 , sev) ;
1191
+ assert_eq ! ( aiow. as_ref( ) as * const libc:: aiocb,
1192
+ & aiow as * const AioWrite as * const libc:: aiocb) ;
1193
+ }
1194
+
1195
+ #[ cfg( target_os = "freebsd" ) ]
1196
+ #[ test]
1197
+ fn casting_vectored ( ) {
1198
+ let sev = SigevNotify :: SigevNone ;
1199
+
1200
+ let mut rbuf = [ ] ;
1188
1201
let mut rbufs = [ IoSliceMut :: new ( & mut rbuf) ] ;
1189
1202
let aiorv = AioReadv :: new ( 666 , 0 , & mut rbufs[ ..] , 0 , sev) ;
1190
1203
assert_eq ! ( aiorv. as_ref( ) as * const libc:: aiocb,
1191
1204
& aiorv as * const AioReadv as * const libc:: aiocb) ;
1192
1205
1193
1206
let wbuf = [ ] ;
1194
- let aiow = AioWrite :: new ( 666 , 0 , & wbuf, 0 , sev) ;
1195
- assert_eq ! ( aiow. as_ref( ) as * const libc:: aiocb,
1196
- & aiow as * const AioWrite as * const libc:: aiocb) ;
1197
-
1198
1207
let wbufs = [ IoSlice :: new ( & wbuf) ] ;
1199
1208
let aiowv = AioWritev :: new ( 666 , 0 , & wbufs, 0 , sev) ;
1200
1209
assert_eq ! ( aiowv. as_ref( ) as * const libc:: aiocb,
0 commit comments