MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / test_compilation

Function test_compilation

src/buffer.rs:332–368  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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]

Callers

nothing calls this directly

Calls 3

spare_capacityFunction · 0.85
openFunction · 0.70
readFunction · 0.50

Tested by

no test coverage detected