@@ -588,11 +588,11 @@ impl<T: ?Sized> Arc<T> {
588588}
589589
590590impl < T : ?Sized > Arc < T > {
591- // Allocates an `ArcInner<T>` with sufficient space for
592- // an unsized value where the value has the layout provided.
593- //
594- // The function `mem_to_arcinner` is called with the data pointer
595- // and must return back a (potentially fat)-pointer for the `ArcInner<T>`.
591+ /// Allocates an `ArcInner<T>` with sufficient space for
592+ /// an unsized value where the value has the layout provided.
593+ ///
594+ /// The function `mem_to_arcinner` is called with the data pointer
595+ /// and must return back a (potentially fat)-pointer for the `ArcInner<T>`.
596596 unsafe fn allocate_for_unsized (
597597 value_layout : Layout ,
598598 mem_to_arcinner : impl FnOnce ( * mut u8 ) -> * mut ArcInner < T >
@@ -618,7 +618,7 @@ impl<T: ?Sized> Arc<T> {
618618 inner
619619 }
620620
621- // Allocates an `ArcInner<T>` with sufficient space for an unsized value
621+ /// Allocates an `ArcInner<T>` with sufficient space for an unsized value.
622622 unsafe fn allocate_for_ptr ( ptr : * const T ) -> * mut ArcInner < T > {
623623 // Allocate for the `ArcInner<T>` using the given value.
624624 Self :: allocate_for_unsized (
@@ -650,7 +650,7 @@ impl<T: ?Sized> Arc<T> {
650650}
651651
652652impl < T > Arc < [ T ] > {
653- // Allocates an `ArcInner<[T]>` with the given length.
653+ /// Allocates an `ArcInner<[T]>` with the given length.
654654 unsafe fn allocate_for_slice ( len : usize ) -> * mut ArcInner < [ T ] > {
655655 Self :: allocate_for_unsized (
656656 Layout :: array :: < T > ( len) . unwrap ( ) ,
@@ -659,19 +659,19 @@ impl<T> Arc<[T]> {
659659 }
660660}
661661
662- // Sets the data pointer of a `?Sized` raw pointer.
663- //
664- // For a slice/trait object, this sets the `data` field and leaves the rest
665- // unchanged. For a sized raw pointer, this simply sets the pointer.
662+ /// Sets the data pointer of a `?Sized` raw pointer.
663+ ///
664+ /// For a slice/trait object, this sets the `data` field and leaves the rest
665+ /// unchanged. For a sized raw pointer, this simply sets the pointer.
666666unsafe fn set_data_ptr < T : ?Sized , U > ( mut ptr : * mut T , data : * mut U ) -> * mut T {
667667 ptr:: write ( & mut ptr as * mut _ as * mut * mut u8 , data as * mut u8 ) ;
668668 ptr
669669}
670670
671671impl < T > Arc < [ T ] > {
672- // Copy elements from slice into newly allocated Arc<[T]>
673- //
674- // Unsafe because the caller must either take ownership or bind `T: Copy`
672+ /// Copy elements from slice into newly allocated Arc<[T]>
673+ ///
674+ /// Unsafe because the caller must either take ownership or bind `T: Copy`.
675675 unsafe fn copy_from_slice ( v : & [ T ] ) -> Arc < [ T ] > {
676676 let ptr = Self :: allocate_for_slice ( v. len ( ) ) ;
677677
@@ -735,7 +735,7 @@ impl<T> Arc<[T]> {
735735 }
736736}
737737
738- // Specialization trait used for From<&[T]>
738+ /// Specialization trait used for ` From<&[T]>`.
739739trait ArcFromSlice < T > {
740740 fn from_slice ( slice : & [ T ] ) -> Self ;
741741}
@@ -1903,7 +1903,7 @@ impl<T, I: iter::TrustedLen<Item = T>> ArcFromIter<T, I> for Arc<[T]> {
19031903
19041904impl < ' a , T : ' a + Clone > ArcFromIter < & ' a T , slice:: Iter < ' a , T > > for Arc < [ T ] > {
19051905 fn from_iter ( iter : slice:: Iter < ' a , T > ) -> Self {
1906- // Delegate to `impl<T: Clone> From<&[T]> for Rc <[T]>`.
1906+ // Delegate to `impl<T: Clone> From<&[T]> for Arc <[T]>`.
19071907 //
19081908 // In the case that `T: Copy`, we get to use `ptr::copy_nonoverlapping`
19091909 // which is even more performant.
0 commit comments