This commit is contained in:
The Miri Conjob Bot 2024-02-22 05:03:17 +00:00
parent 76a596c48d
commit 6f3bc7d938
2 changed files with 5 additions and 3 deletions

View file

@ -155,8 +155,9 @@ fn test_mremap() {
// Test all of our error conditions
// Not aligned
let ptr =
unsafe { libc::mremap(ptr::without_provenance_mut(1), page_size, page_size, libc::MREMAP_MAYMOVE) };
let ptr = unsafe {
libc::mremap(ptr::without_provenance_mut(1), page_size, page_size, libc::MREMAP_MAYMOVE)
};
assert_eq!(ptr, libc::MAP_FAILED);
assert_eq!(Error::last_os_error().raw_os_error().unwrap(), libc::EINVAL);

View file

@ -29,7 +29,8 @@ fn slice_of_zst() {
// In a slice of zero-size elements the pointer is meaningless.
// Ensure iteration still works even if the pointer is at the end of the address space.
let slice: &[()] = unsafe { slice::from_raw_parts(ptr::without_provenance(-5isize as usize), 10) };
let slice: &[()] =
unsafe { slice::from_raw_parts(ptr::without_provenance(-5isize as usize), 10) };
assert_eq!(slice.len(), 10);
assert_eq!(slice.iter().count(), 10);