File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -74,15 +74,15 @@ fn vec_reallocate() -> Vec<u8> {
7474fn vec_push_ptr_stable ( ) {
7575 let mut v = Vec :: with_capacity ( 10 ) ;
7676 v. push ( 0 ) ;
77- let v0 = unsafe { & * ( & v[ 0 ] as * const _ ) } ; // laundering the lifetime -- we take care that `v` does not reallocate, so that's okay.
77+ let v0 = unsafe { & mut * ( & mut v[ 0 ] as * mut _ ) } ; // laundering the lifetime -- we take care that `v` does not reallocate, so that's okay.
7878 v. push ( 1 ) ;
7979 let _val = * v0;
8080}
8181
8282fn vec_extend_ptr_stable ( ) {
8383 let mut v = Vec :: with_capacity ( 10 ) ;
8484 v. push ( 0 ) ;
85- let v0 = unsafe { & * ( & v[ 0 ] as * const _ ) } ; // laundering the lifetime -- we take care that `v` does not reallocate, so that's okay.
85+ let v0 = unsafe { & mut * ( & mut v[ 0 ] as * mut _ ) } ; // laundering the lifetime -- we take care that `v` does not reallocate, so that's okay.
8686 // `slice::Iter` (with `T: Copy`) specialization
8787 v. extend ( & [ 1 ] ) ;
8888 let _val = * v0;
@@ -99,7 +99,7 @@ fn vec_extend_ptr_stable() {
9999
100100fn vec_truncate_ptr_stable ( ) {
101101 let mut v = vec ! [ 0 ; 10 ] ;
102- let v0 = unsafe { & * ( & v[ 0 ] as * const _ ) } ; // laundering the lifetime -- we take care that `v` does not reallocate, so that's okay.
102+ let v0 = unsafe { & mut * ( & mut v[ 0 ] as * mut _ ) } ; // laundering the lifetime -- we take care that `v` does not reallocate, so that's okay.
103103 v. truncate ( 5 ) ;
104104 let _val = * v0;
105105}
You can’t perform that action at this time.
0 commit comments