File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ mod platform {
9494 struct Header ( * mut u8 ) ;
9595 const HEAP_ZERO_MEMORY : DWORD = 0x00000008 ;
9696 unsafe fn get_header < ' a > ( ptr : * mut u8 ) -> & ' a mut Header {
97- & mut * ( ptr as * mut Header ) . offset ( - 1 )
97+ & mut * ( ptr as * mut Header ) . sub ( 1 )
9898 }
9999 unsafe fn align_ptr ( ptr : * mut u8 , align : usize ) -> * mut u8 {
100100 let aligned = ptr. add ( align - ( ptr as usize & ( align - 1 ) ) ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ pub(crate) fn unsized_info<'tcx>(
2929 let old_info =
3030 old_info. expect ( "unsized_info: missing old info for trait upcasting coercion" ) ;
3131 if data_a. principal_def_id ( ) == data_b. principal_def_id ( ) {
32+ // A NOP cast that doesn't actually change anything, should be allowed even with invalid vtables.
3233 return old_info;
3334 }
3435
You can’t perform that action at this time.
0 commit comments