@@ -15,9 +15,9 @@ use super::{EvalContext, Machine, PlaceTy, OpTy, Value};
15
15
impl < ' a , ' mir , ' tcx , M : Machine < ' mir , ' tcx > > EvalContext < ' a , ' mir , ' tcx , M > {
16
16
fn type_is_fat_ptr ( & self , ty : Ty < ' tcx > ) -> bool {
17
17
match ty. sty {
18
- ty:: TyRawPtr ( ty:: TypeAndMut { ty, .. } ) |
19
- ty:: TyRef ( _, ty, _) => !self . type_is_sized ( ty) ,
20
- ty:: TyAdt ( def, _) if def. is_box ( ) => !self . type_is_sized ( ty. boxed_ty ( ) ) ,
18
+ ty:: RawPtr ( ty:: TypeAndMut { ty, .. } ) |
19
+ ty:: Ref ( _, ty, _) => !self . type_is_sized ( ty) ,
20
+ ty:: Adt ( def, _) if def. is_box ( ) => !self . type_is_sized ( ty. boxed_ty ( ) ) ,
21
21
_ => false ,
22
22
}
23
23
}
@@ -313,19 +313,19 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
313
313
let ( src_pointee_ty, dest_pointee_ty) = self . tcx . struct_lockstep_tails ( sty, dty) ;
314
314
315
315
match ( & src_pointee_ty. sty , & dest_pointee_ty. sty ) {
316
- ( & ty:: TyArray ( _, length) , & ty:: TySlice ( _) ) => {
316
+ ( & ty:: Array ( _, length) , & ty:: Slice ( _) ) => {
317
317
let ptr = self . read_value ( src) ?. to_scalar_ptr ( ) ?;
318
318
// u64 cast is from usize to u64, which is always good
319
319
let val = Value :: new_slice ( ptr, length. unwrap_usize ( self . tcx . tcx ) , self . tcx . tcx ) ;
320
320
self . write_value ( val, dest)
321
321
}
322
- ( & ty:: TyDynamic ( ..) , & ty:: TyDynamic ( ..) ) => {
322
+ ( & ty:: Dynamic ( ..) , & ty:: Dynamic ( ..) ) => {
323
323
// For now, upcasts are limited to changes in marker
324
324
// traits, and hence never actually require an actual
325
325
// change to the vtable.
326
326
self . copy_op ( src, dest)
327
327
}
328
- ( _, & ty:: TyDynamic ( ref data, _) ) => {
328
+ ( _, & ty:: Dynamic ( ref data, _) ) => {
329
329
// Initial cast from sized to dyn trait
330
330
let trait_ref = data. principal ( ) . unwrap ( ) . with_self_ty (
331
331
* self . tcx ,
@@ -348,13 +348,13 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
348
348
dest : PlaceTy < ' tcx > ,
349
349
) -> EvalResult < ' tcx > {
350
350
match ( & src. layout . ty . sty , & dest. layout . ty . sty ) {
351
- ( & ty:: TyRef ( _, s, _) , & ty:: TyRef ( _, d, _) ) |
352
- ( & ty:: TyRef ( _, s, _) , & ty:: TyRawPtr ( TypeAndMut { ty : d, .. } ) ) |
353
- ( & ty:: TyRawPtr ( TypeAndMut { ty : s, .. } ) ,
354
- & ty:: TyRawPtr ( TypeAndMut { ty : d, .. } ) ) => {
351
+ ( & ty:: Ref ( _, s, _) , & ty:: Ref ( _, d, _) ) |
352
+ ( & ty:: Ref ( _, s, _) , & ty:: RawPtr ( TypeAndMut { ty : d, .. } ) ) |
353
+ ( & ty:: RawPtr ( TypeAndMut { ty : s, .. } ) ,
354
+ & ty:: RawPtr ( TypeAndMut { ty : d, .. } ) ) => {
355
355
self . unsize_into_ptr ( src, dest, s, d)
356
356
}
357
- ( & ty:: TyAdt ( def_a, _) , & ty:: TyAdt ( def_b, _) ) => {
357
+ ( & ty:: Adt ( def_a, _) , & ty:: Adt ( def_b, _) ) => {
358
358
assert_eq ! ( def_a, def_b) ;
359
359
if def_a. is_box ( ) || def_b. is_box ( ) {
360
360
if !def_a. is_box ( ) || !def_b. is_box ( ) {
0 commit comments