@@ -771,7 +771,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
771
771
match ( field_index, & self . tcx . struct_tail ( ty) . sty ) {
772
772
( 1 , & ty:: TyStr ) |
773
773
( 1 , & ty:: TySlice ( _) ) => Ok ( self . tcx . types . usize ) ,
774
- ( 1 , & ty:: TyTrait ( _ ) ) |
774
+ ( 1 , & ty:: TyDynamic ( .. ) ) |
775
775
( 0 , _) => Ok ( self . tcx . mk_imm_ptr ( self . tcx . types . u8 ) ) ,
776
776
_ => bug ! ( "invalid fat pointee type: {}" , ty) ,
777
777
}
@@ -1009,7 +1009,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
1009
1009
trace ! ( "deref to {} on {:?}" , pointee_type, val) ;
1010
1010
1011
1011
match self . tcx . struct_tail ( pointee_type) . sty {
1012
- ty:: TyTrait ( _ ) => {
1012
+ ty:: TyDynamic ( .. ) => {
1013
1013
let ( ptr, vtable) = val. expect_ptr_vtable_pair ( & self . memory ) ?;
1014
1014
( ptr, LvalueExtra :: Vtable ( vtable) )
1015
1015
} ,
@@ -1462,7 +1462,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
1462
1462
trace ! ( "reading fat pointer extra of type {}" , ty) ;
1463
1463
let extra = ptr. offset ( self . memory . pointer_size ( ) ) ;
1464
1464
let extra = match self . tcx . struct_tail ( ty) . sty {
1465
- ty:: TyTrait ( ..) => PrimVal :: from_ptr ( self . memory . read_ptr ( extra) ?) ,
1465
+ ty:: TyDynamic ( ..) => PrimVal :: from_ptr ( self . memory . read_ptr ( extra) ?) ,
1466
1466
ty:: TySlice ( ..) |
1467
1467
ty:: TyStr => PrimVal :: from_uint ( self . memory . read_usize ( extra) ?) ,
1468
1468
_ => bug ! ( "unsized primval ptr read from {:?}" , ty) ,
@@ -1529,14 +1529,14 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
1529
1529
let ptr = PrimVal :: from_ptr ( ptr) ;
1530
1530
self . write_value ( Value :: ByValPair ( ptr, len) , dest, dest_ty) ?;
1531
1531
}
1532
- ( & ty:: TyTrait ( _ ) , & ty:: TyTrait ( _ ) ) => {
1532
+ ( & ty:: TyDynamic ( .. ) , & ty:: TyDynamic ( .. ) ) => {
1533
1533
// For now, upcasts are limited to changes in marker
1534
1534
// traits, and hence never actually require an actual
1535
1535
// change to the vtable.
1536
1536
self . write_value ( src, dest, dest_ty) ?;
1537
1537
} ,
1538
- ( _, & ty:: TyTrait ( ref data) ) => {
1539
- let trait_ref = data. principal . with_self_ty ( self . tcx , src_pointee_ty) ;
1538
+ ( _, & ty:: TyDynamic ( ref data, _ ) ) => {
1539
+ let trait_ref = data. principal ( ) . unwrap ( ) . with_self_ty ( self . tcx , src_pointee_ty) ;
1540
1540
let trait_ref = self . tcx . erase_regions ( & trait_ref) ;
1541
1541
let vtable = self . get_vtable ( trait_ref) ?;
1542
1542
let ptr = src. read_ptr ( & self . memory ) ?;
0 commit comments