@@ -530,7 +530,7 @@ where
530530 /// ### Safety
531531 ///
532532 /// The whole of the array must be initialized before it is converted
533- /// using [`.assume_init()`] or otherwise traversed.
533+ /// using [`.assume_init()`] or otherwise traversed/read with the element type `A` .
534534 ///
535535 /// ### Examples
536536 ///
@@ -580,10 +580,10 @@ where
580580 /// The uninitialized elements of type `A` are represented by the type `MaybeUninit<A>`,
581581 /// an easier way to handle uninit values correctly.
582582 ///
583- /// The `builder` closure gets unshared access to the array through a raw view
584- /// and can use it to modify the array before it is returned. This allows initializing
585- /// the array for any owned array type (avoiding clone requirements for copy-on-write,
586- /// because the array is unshared when initially created).
583+ /// The `builder` closure gets unshared access to the array through a view and can use it to
584+ /// modify the array before it is returned. This allows initializing the array for any owned
585+ /// array type (avoiding clone requirements for copy-on-write, because the array is unshared
586+ /// when initially created).
587587 ///
588588 /// Only *when* the array is completely initialized with valid elements, can it be
589589 /// converted to an array of `A` elements using [`.assume_init()`].
@@ -593,17 +593,18 @@ where
593593 /// ### Safety
594594 ///
595595 /// The whole of the array must be initialized before it is converted
596- /// using [`.assume_init()`] or otherwise traversed.
596+ /// using [`.assume_init()`] or otherwise traversed/read with the element type `A` .
597597 ///
598- pub ( crate ) fn build_uninit < Sh , F > ( shape : Sh , builder : F ) -> ArrayBase < S :: MaybeUninit , D >
598+ /// [`.assume_init()`]: ArrayBase::assume_init
599+ pub fn build_uninit < Sh , F > ( shape : Sh , builder : F ) -> ArrayBase < S :: MaybeUninit , D >
599600 where
600601 Sh : ShapeBuilder < Dim = D > ,
601- F : FnOnce ( RawArrayViewMut < MaybeUninit < A > , D > ) ,
602+ F : FnOnce ( ArrayViewMut < MaybeUninit < A > , D > ) ,
602603 {
603604 let mut array = Self :: uninit ( shape) ;
604605 // Safe because: the array is unshared here
605606 unsafe {
606- builder ( array. raw_view_mut_unchecked ( ) ) ;
607+ builder ( array. raw_view_mut_unchecked ( ) . deref_into_view_mut ( ) ) ;
607608 }
608609 array
609610 }
0 commit comments