File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed
library/std/src/sys/pal/sgx/abi/usercalls Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -143,12 +143,6 @@ unsafe impl<T: UserSafeSized> UserSafe for [T] {
143143 align_of :: < T > ( )
144144 }
145145
146- /// # Safety
147- /// Behavior is undefined if any of these conditions are violated:
148- /// * `ptr` must be [valid] for writes of `size` many bytes, and it must be
149- /// properly aligned.
150- ///
151- /// [valid]: core::ptr#safety
152146 /// # Panics
153147 ///
154148 /// This function panics if:
@@ -158,8 +152,7 @@ unsafe impl<T: UserSafeSized> UserSafe for [T] {
158152 let elem_size = size_of :: < T > ( ) ;
159153 assert_eq ! ( size % elem_size, 0 ) ;
160154 let len = size / elem_size;
161- // SAFETY: The caller must uphold the safety contract for `from_raw_sized_unchecked`
162- unsafe { slice:: from_raw_parts_mut ( ptr as _ , len) }
155+ ptr:: slice_from_raw_parts_mut ( ptr as _ , len)
163156 }
164157}
165158
You can’t perform that action at this time.
0 commit comments