@@ -71,7 +71,7 @@ fn test_mmap<Offset: Default>(
7171
7272 let ptr = unsafe {
7373 mmap (
74- ptr:: invalid_mut ( page_size * 64 ) ,
74+ ptr:: without_provenance_mut ( page_size * 64 ) ,
7575 page_size,
7676 libc:: PROT_READ | libc:: PROT_WRITE ,
7777 // We don't support MAP_FIXED
@@ -114,13 +114,13 @@ fn test_mmap<Offset: Default>(
114114 assert_eq ! ( ptr, libc:: MAP_FAILED ) ;
115115
116116 // 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) } ;
118118 assert_eq ! ( res, -1 ) ;
119119 assert_eq ! ( Error :: last_os_error( ) . raw_os_error( ) . unwrap( ) , libc:: EINVAL ) ;
120120
121121 // We report an error when trying to munmap a length that cannot be rounded up to a multiple of
122122 // 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 ) } ;
124124 assert_eq ! ( res, -1 ) ;
125125 assert_eq ! ( Error :: last_os_error( ) . raw_os_error( ) . unwrap( ) , libc:: EINVAL ) ;
126126}
@@ -156,7 +156,7 @@ fn test_mremap() {
156156 // Test all of our error conditions
157157 // Not aligned
158158 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 ) } ;
160160 assert_eq ! ( ptr, libc:: MAP_FAILED ) ;
161161 assert_eq ! ( Error :: last_os_error( ) . raw_os_error( ) . unwrap( ) , libc:: EINVAL ) ;
162162
0 commit comments