File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,23 @@ struct Ccx {
2222 x : isize ,
2323}
2424
25- fn allocate ( _bcx : & arena ) -> & Bcx < ' _ > {
25+ fn allocate ( _bcx : & arena ) -> & mut Bcx < ' _ > {
2626 unsafe {
2727 let layout = Layout :: new :: < Bcx > ( ) ;
2828 let ptr = Global . allocate ( layout) . unwrap_or_else ( |_| handle_alloc_error ( layout) ) ;
29- & * ( ptr. as_ptr ( ) as * const _ )
29+ & mut * ptr. as_ptr ( ) . cast ( )
3030 }
3131}
3232
33- fn h < ' a > ( bcx : & ' a Bcx < ' a > ) -> & ' a Bcx < ' a > {
33+ fn h < ' a > ( bcx : & ' a Bcx < ' a > ) -> & ' a mut Bcx < ' a > {
3434 return allocate ( bcx. fcx . arena ) ;
3535}
3636
3737fn g ( fcx : & Fcx ) {
3838 let bcx = Bcx { fcx } ;
3939 let bcx2 = h ( & bcx) ;
4040 unsafe {
41- Global . deallocate ( NonNull :: new_unchecked ( bcx2 as * const _ as * mut _ ) , Layout :: new :: < Bcx > ( ) ) ;
41+ Global . deallocate ( NonNull :: new_unchecked ( bcx2 as * mut _ as * mut _ ) , Layout :: new :: < Bcx > ( ) ) ;
4242 }
4343}
4444
You can’t perform that action at this time.
0 commit comments