@@ -85,6 +85,10 @@ impl<'a, T, A: Alloc> RawVec<'a, T, A> {
8585
8686 /// Like `with_capacity` but parameterized over the choice of
8787 /// allocator for the returned RawVec.
88+ ///
89+ /// # Panics
90+ ///
91+ /// Panics if `cap` is too large.
8892 #[ inline]
8993 pub fn with_capacity_in ( cap : usize , alloc : & ' a A ) -> Self {
9094 unsafe {
@@ -358,6 +362,10 @@ impl<'a, T, A: Alloc> RawVec<'a, T, A> {
358362 */
359363
360364 /// The same as `reserve_exact`, but returns on errors instead of panicking or aborting.
365+ ///
366+ /// # Errors
367+ ///
368+ /// Returns `Err(AllocError)` if unable to reserve requested space in the `RawVec`.
361369 pub fn try_reserve_exact ( & mut self , len : u32 , additional : usize ) -> Result < ( ) , AllocError > {
362370 if self . needs_to_grow ( len, additional) {
363371 self . grow_exact ( len, additional) ?
@@ -394,6 +402,10 @@ impl<'a, T, A: Alloc> RawVec<'a, T, A> {
394402 }
395403
396404 /// The same as `reserve`, but returns on errors instead of panicking or aborting.
405+ ///
406+ /// # Errors
407+ ///
408+ /// Returns `Err(AllocError)` if unable to reserve requested space in the `RawVec`.
397409 pub fn try_reserve ( & mut self , len : u32 , additional : usize ) -> Result < ( ) , AllocError > {
398410 if self . needs_to_grow ( len, additional) {
399411 self . grow_amortized ( len, additional) ?;
@@ -756,6 +768,10 @@ impl<T, A: Alloc> RawVec<'_, T, A> {
756768
757769impl < T , A : Alloc > RawVec < ' _ , T , A > {
758770 /// Frees the memory owned by the RawVec *without* trying to Drop its contents.
771+ ///
772+ /// # SAFETY
773+ ///
774+ /// Not sure what safety invariants of this method are! TODO
759775 pub unsafe fn dealloc_buffer ( & mut self ) {
760776 let elem_size = mem:: size_of :: < T > ( ) ;
761777 if elem_size != 0 {
0 commit comments