File tree Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
157
157
this. get_alloc_bytes_unchecked_raw ( alloc_id) ?
158
158
}
159
159
}
160
- AllocKind :: Function | AllocKind :: VTable => {
160
+ AllocKind :: Function | AllocKind :: Virtual => {
161
161
// Allocate some dummy memory to get a unique address for this function/vtable.
162
162
let alloc_bytes = MiriAllocBytes :: from_bytes (
163
163
& [ 0u8 ; 1 ] ,
Original file line number Diff line number Diff line change @@ -650,7 +650,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
650
650
dcx. log_protector ( ) ;
651
651
}
652
652
} ,
653
- AllocKind :: Function | AllocKind :: VTable | AllocKind :: Dead => {
653
+ AllocKind :: Function | AllocKind :: Virtual | AllocKind :: Dead => {
654
654
// No stacked borrows on these allocations.
655
655
}
656
656
}
@@ -1021,7 +1021,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1021
1021
trace ! ( "Stacked Borrows tag {tag:?} exposed in {alloc_id:?}" ) ;
1022
1022
alloc_extra. borrow_tracker_sb ( ) . borrow_mut ( ) . exposed_tags . insert ( tag) ;
1023
1023
}
1024
- AllocKind :: Function | AllocKind :: VTable | AllocKind :: Dead => {
1024
+ AllocKind :: Function | AllocKind :: Virtual | AllocKind :: Dead => {
1025
1025
// No stacked borrows on these allocations.
1026
1026
}
1027
1027
}
Original file line number Diff line number Diff line change @@ -673,7 +673,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
673
673
trace ! ( "Tree Borrows tag {tag:?} exposed in {alloc_id:?}" ) ;
674
674
alloc_extra. borrow_tracker_tb ( ) . borrow_mut ( ) . expose_tag ( tag) ;
675
675
}
676
- AllocKind :: Function | AllocKind :: VTable | AllocKind :: Dead => {
676
+ AllocKind :: Function | AllocKind :: Virtual | AllocKind :: Dead => {
677
677
// No tree borrows on these allocations.
678
678
}
679
679
}
Original file line number Diff line number Diff line change
1
+ use std:: any:: { Any , TypeId } ;
2
+
3
+ fn main ( ) {
4
+ let t1 = TypeId :: of :: < u64 > ( ) ;
5
+ let t2 = TypeId :: of :: < u64 > ( ) ;
6
+ assert_eq ! ( t1, t2) ;
7
+ let t3 = TypeId :: of :: < usize > ( ) ;
8
+ assert_ne ! ( t1, t3) ;
9
+
10
+ let _ = format ! ( "{t1:?}" ) ; // test that we can debug-print
11
+
12
+ let b = Box :: new ( 0u64 ) as Box < dyn Any > ;
13
+ assert_eq ! ( * b. downcast_ref:: <u64 >( ) . unwrap( ) , 0 ) ;
14
+ assert ! ( b. downcast_ref:: <usize >( ) . is_none( ) ) ;
15
+
16
+ // Get the first pointer chunk and try to make it a ZST ref.
17
+ // This used to trigger an error because TypeId allocs got misclassified as "LiveData".
18
+ let _raw_chunk = unsafe { ( & raw const t1) . cast :: < & ( ) > ( ) . read ( ) } ;
19
+ }
You can’t perform that action at this time.
0 commit comments