@@ -71,7 +71,7 @@ fn test_mmap<Offset: Default>(
71
71
72
72
let ptr = unsafe {
73
73
mmap (
74
- ptr:: invalid_mut ( page_size * 64 ) ,
74
+ ptr:: without_provenance_mut ( page_size * 64 ) ,
75
75
page_size,
76
76
libc:: PROT_READ | libc:: PROT_WRITE ,
77
77
// We don't support MAP_FIXED
@@ -114,13 +114,13 @@ fn test_mmap<Offset: Default>(
114
114
assert_eq ! ( ptr, libc:: MAP_FAILED ) ;
115
115
116
116
// We report an error when trying to munmap an address which is not a multiple of the page size
117
- let res = unsafe { libc:: munmap ( ptr:: invalid_mut ( 1 ) , page_size) } ;
117
+ let res = unsafe { libc:: munmap ( ptr:: without_provenance_mut ( 1 ) , page_size) } ;
118
118
assert_eq ! ( res, -1 ) ;
119
119
assert_eq ! ( Error :: last_os_error( ) . raw_os_error( ) . unwrap( ) , libc:: EINVAL ) ;
120
120
121
121
// We report an error when trying to munmap a length that cannot be rounded up to a multiple of
122
122
// the page size.
123
- let res = unsafe { libc:: munmap ( ptr:: invalid_mut ( page_size) , usize:: MAX - 1 ) } ;
123
+ let res = unsafe { libc:: munmap ( ptr:: without_provenance_mut ( page_size) , usize:: MAX - 1 ) } ;
124
124
assert_eq ! ( res, -1 ) ;
125
125
assert_eq ! ( Error :: last_os_error( ) . raw_os_error( ) . unwrap( ) , libc:: EINVAL ) ;
126
126
}
@@ -156,7 +156,7 @@ fn test_mremap() {
156
156
// Test all of our error conditions
157
157
// Not aligned
158
158
let ptr =
159
- unsafe { libc:: mremap ( ptr:: invalid_mut ( 1 ) , page_size, page_size, libc:: MREMAP_MAYMOVE ) } ;
159
+ unsafe { libc:: mremap ( ptr:: without_provenance_mut ( 1 ) , page_size, page_size, libc:: MREMAP_MAYMOVE ) } ;
160
160
assert_eq ! ( ptr, libc:: MAP_FAILED ) ;
161
161
assert_eq ! ( Error :: last_os_error( ) . raw_os_error( ) . unwrap( ) , libc:: EINVAL ) ;
162
162
0 commit comments