@@ -126,7 +126,7 @@ pub unsafe trait AllocRef {
126126 /// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar.
127127 ///
128128 /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
129- fn alloc_zeroed ( & mut self , layout : Layout ) -> Result < NonNull < [ u8 ] > , AllocErr > {
129+ fn alloc_zeroed ( & self , layout : Layout ) -> Result < NonNull < [ u8 ] > , AllocErr > {
130130 let ptr = self . alloc ( layout) ?;
131131 // SAFETY: `alloc` returns a valid memory block
132132 unsafe { ptr. as_non_null_ptr ( ) . as_ptr ( ) . write_bytes ( 0 , ptr. len ( ) ) }
@@ -142,7 +142,7 @@ pub unsafe trait AllocRef {
142142 ///
143143 /// [*currently allocated*]: #currently-allocated-memory
144144 /// [*fit*]: #memory-fitting
145- unsafe fn dealloc ( & mut self , ptr : NonNull < u8 > , layout : Layout ) ;
145+ unsafe fn dealloc ( & self , ptr : NonNull < u8 > , layout : Layout ) ;
146146
147147 /// Attempts to extend the memory block.
148148 ///
@@ -353,12 +353,12 @@ where
353353 }
354354
355355 #[ inline]
356- fn alloc_zeroed ( & mut self , layout : Layout ) -> Result < NonNull < [ u8 ] > , AllocErr > {
356+ fn alloc_zeroed ( & self , layout : Layout ) -> Result < NonNull < [ u8 ] > , AllocErr > {
357357 ( * * self ) . alloc_zeroed ( layout)
358358 }
359359
360360 #[ inline]
361- unsafe fn dealloc ( & mut self , ptr : NonNull < u8 > , layout : Layout ) {
361+ unsafe fn dealloc ( & self , ptr : NonNull < u8 > , layout : Layout ) {
362362 // SAFETY: the safety contract must be upheld by the caller
363363 unsafe { ( * * self ) . dealloc ( ptr, layout) }
364364 }
0 commit comments