File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,23 @@ struct Ccx {
22
22
x : isize ,
23
23
}
24
24
25
- fn allocate ( _bcx : & arena ) -> & Bcx < ' _ > {
25
+ fn allocate ( _bcx : & arena ) -> & mut Bcx < ' _ > {
26
26
unsafe {
27
27
let layout = Layout :: new :: < Bcx > ( ) ;
28
28
let ptr = Global . allocate ( layout) . unwrap_or_else ( |_| handle_alloc_error ( layout) ) ;
29
- & * ( ptr. as_ptr ( ) as * const _ )
29
+ & mut * ptr. as_ptr ( ) . cast ( )
30
30
}
31
31
}
32
32
33
- fn h < ' a > ( bcx : & ' a Bcx < ' a > ) -> & ' a Bcx < ' a > {
33
+ fn h < ' a > ( bcx : & ' a Bcx < ' a > ) -> & ' a mut Bcx < ' a > {
34
34
return allocate ( bcx. fcx . arena ) ;
35
35
}
36
36
37
37
fn g ( fcx : & Fcx ) {
38
38
let bcx = Bcx { fcx } ;
39
39
let bcx2 = h ( & bcx) ;
40
40
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 > ( ) ) ;
42
42
}
43
43
}
44
44
You can’t perform that action at this time.
0 commit comments