()
| 330 | #[cfg(not(windows))] |
| 331 | #[test] |
| 332 | fn test_compilation() { |
| 333 | use crate::io::read; |
| 334 | use core::mem::MaybeUninit; |
| 335 | |
| 336 | // We need to obtain input stream, so open our own source file. |
| 337 | let input = std::fs::File::open("src/buffer.rs").unwrap(); |
| 338 | |
| 339 | let mut buf = vec![0_u8; 3]; |
| 340 | buf.reserve(32); |
| 341 | let _x: usize = read(&input, spare_capacity(&mut buf)).unwrap(); |
| 342 | let _x: (&mut [u8], &mut [MaybeUninit<u8>]) = |
| 343 | read(&input, buf.spare_capacity_mut()).unwrap(); |
| 344 | let _x: usize = read(&input, &mut buf).unwrap(); |
| 345 | let _x: usize = read(&input, &mut *buf).unwrap(); |
| 346 | let _x: usize = read(&input, &mut buf[..]).unwrap(); |
| 347 | let _x: usize = read(&input, &mut (*buf)[..]).unwrap(); |
| 348 | |
| 349 | let mut buf = [0, 0, 0]; |
| 350 | let _x: usize = read(&input, &mut buf).unwrap(); |
| 351 | let _x: usize = read(&input, &mut buf[..]).unwrap(); |
| 352 | |
| 353 | let mut buf = [ |
| 354 | MaybeUninit::uninit(), |
| 355 | MaybeUninit::uninit(), |
| 356 | MaybeUninit::uninit(), |
| 357 | ]; |
| 358 | let _x: (&mut [u8], &mut [MaybeUninit<u8>]) = read(&input, &mut buf).unwrap(); |
| 359 | let _x: (&mut [u8], &mut [MaybeUninit<u8>]) = read(&input, &mut buf[..]).unwrap(); |
| 360 | |
| 361 | let mut buf = vec![ |
| 362 | MaybeUninit::uninit(), |
| 363 | MaybeUninit::uninit(), |
| 364 | MaybeUninit::uninit(), |
| 365 | ]; |
| 366 | let _x: (&mut [u8], &mut [MaybeUninit<u8>]) = read(&input, &mut buf).unwrap(); |
| 367 | let _x: (&mut [u8], &mut [MaybeUninit<u8>]) = read(&input, &mut buf[..]).unwrap(); |
| 368 | } |
| 369 | |
| 370 | #[cfg(not(windows))] |
| 371 | #[test] |
nothing calls this directly
no test coverage detected