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 {
94
94
struct Header ( * mut u8 ) ;
95
95
const HEAP_ZERO_MEMORY : DWORD = 0x00000008 ;
96
96
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 )
98
98
}
99
99
unsafe fn align_ptr ( ptr : * mut u8 , align : usize ) -> * mut u8 {
100
100
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>(
29
29
let old_info =
30
30
old_info. expect ( "unsized_info: missing old info for trait upcasting coercion" ) ;
31
31
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.
32
33
return old_info;
33
34
}
34
35
You can’t perform that action at this time.
0 commit comments