@@ -930,7 +930,7 @@ impl<'tcx> ctxt<'tcx> {
930
930
sty_debug_print ! (
931
931
self ,
932
932
ty_enum, ty_uniq, ty_vec, ty_ptr, ty_rptr, ty_bare_fn, ty_trait,
933
- ty_struct, ty_closure, ty_tup, ty_param, ty_open , ty_infer, ty_projection) ;
933
+ ty_struct, ty_closure, ty_tup, ty_param, ty_infer, ty_projection) ;
934
934
935
935
println ! ( "Substs interner: #{}" , self . substs_interner. borrow( ) . len( ) ) ;
936
936
println ! ( "BareFnTy interner: #{}" , self . bare_fn_interner. borrow( ) . len( ) ) ;
@@ -1374,12 +1374,6 @@ pub enum sty<'tcx> {
1374
1374
ty_projection( ProjectionTy < ' tcx > ) ,
1375
1375
ty_param( ParamTy ) , // type parameter
1376
1376
1377
- ty_open( Ty < ' tcx > ) , // A deref'ed fat pointer, i.e., a dynamically sized value
1378
- // and its size. Only ever used in trans. It is not necessary
1379
- // earlier since we don't need to distinguish a DST with its
1380
- // size (e.g., in a deref) vs a DST with the size elsewhere (
1381
- // e.g., in a field).
1382
-
1383
1377
ty_infer( InferTy ) , // something used only during inference/typeck
1384
1378
ty_err, // Also only used during inference/typeck, to represent
1385
1379
// the type of an erroneous expression (helps cut down
@@ -2689,7 +2683,7 @@ impl FlagComputation {
2689
2683
self . add_bounds ( bounds) ;
2690
2684
}
2691
2685
2692
- & ty_uniq( tt) | & ty_vec( tt, _) | & ty_open ( tt ) => {
2686
+ & ty_uniq( tt) | & ty_vec( tt, _) => {
2693
2687
self . add_ty ( tt)
2694
2688
}
2695
2689
@@ -2964,8 +2958,6 @@ pub fn mk_param_from_def<'tcx>(cx: &ctxt<'tcx>, def: &TypeParameterDef) -> Ty<'t
2964
2958
mk_param ( cx, def. space , def. index , def. name )
2965
2959
}
2966
2960
2967
- pub fn mk_open < ' tcx > ( cx : & ctxt < ' tcx > , ty : Ty < ' tcx > ) -> Ty < ' tcx > { mk_t ( cx, ty_open ( ty) ) }
2968
-
2969
2961
impl < ' tcx > TyS < ' tcx > {
2970
2962
/// Iterator that walks `self` and any types reachable from
2971
2963
/// `self`, in depth-first order. Note that just walks the types
@@ -3164,7 +3156,6 @@ pub fn sequence_element_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
3164
3156
match ty. sty {
3165
3157
ty_vec( ty, _) => ty,
3166
3158
ty_str => mk_mach_uint ( cx, ast:: TyU8 ) ,
3167
- ty_open( ty) => sequence_element_type ( cx, ty) ,
3168
3159
_ => cx. sess . bug ( & format ! ( "sequence_element_type called on non-sequence value: {}" ,
3169
3160
ty_to_string( cx, ty) ) ) ,
3170
3161
}
@@ -3583,12 +3574,6 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents {
3583
3574
TC :: All
3584
3575
}
3585
3576
3586
- ty_open( ty) => {
3587
- let result = tc_ty ( cx, ty, cache) ;
3588
- assert ! ( !result. is_sized( cx) ) ;
3589
- result. unsafe_pointer ( ) | TC :: Nonsized
3590
- }
3591
-
3592
3577
ty_infer( _) |
3593
3578
ty_err => {
3594
3579
cx. sess . bug ( "asked to compute contents of error type" ) ;
@@ -3747,7 +3732,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool {
3747
3732
ty_vec( _, None ) => {
3748
3733
false
3749
3734
}
3750
- ty_uniq( typ) | ty_open ( typ ) => {
3735
+ ty_uniq( typ) => {
3751
3736
type_requires ( cx, seen, r_ty, typ)
3752
3737
}
3753
3738
ty_rptr( _, ref mt) => {
@@ -4106,14 +4091,6 @@ pub fn deref<'tcx>(ty: Ty<'tcx>, explicit: bool) -> Option<mt<'tcx>> {
4106
4091
}
4107
4092
}
4108
4093
4109
- pub fn close_type < ' tcx > ( cx : & ctxt < ' tcx > , ty : Ty < ' tcx > ) -> Ty < ' tcx > {
4110
- match ty. sty {
4111
- ty_open( ty) => mk_rptr ( cx, cx. mk_region ( ReStatic ) , mt { ty : ty, mutbl : ast:: MutImmutable } ) ,
4112
- _ => cx. sess . bug ( & format ! ( "Trying to close a non-open type {}" ,
4113
- ty_to_string( cx, ty) ) )
4114
- }
4115
- }
4116
-
4117
4094
pub fn type_content < ' tcx > ( ty : Ty < ' tcx > ) -> Ty < ' tcx > {
4118
4095
match ty. sty {
4119
4096
ty_uniq( ty) => ty,
@@ -4122,14 +4099,6 @@ pub fn type_content<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
4122
4099
}
4123
4100
}
4124
4101
4125
- // Extract the unsized type in an open type (or just return ty if it is not open).
4126
- pub fn unopen_type < ' tcx > ( ty : Ty < ' tcx > ) -> Ty < ' tcx > {
4127
- match ty. sty {
4128
- ty_open( ty) => ty,
4129
- _ => ty
4130
- }
4131
- }
4132
-
4133
4102
// Returns the type of ty[i]
4134
4103
pub fn index < ' tcx > ( ty : Ty < ' tcx > ) -> Option < Ty < ' tcx > > {
4135
4104
match ty. sty {
@@ -4802,7 +4771,6 @@ pub fn ty_sort_string<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> String {
4802
4771
}
4803
4772
}
4804
4773
ty_err => "type error" . to_string ( ) ,
4805
- ty_open( _) => "opened DST" . to_string ( ) ,
4806
4774
}
4807
4775
}
4808
4776
@@ -6328,16 +6296,15 @@ pub fn hash_crate_independent<'tcx>(tcx: &ctxt<'tcx>, ty: Ty<'tcx>, svh: &Svh) -
6328
6296
hash ! ( p. idx) ;
6329
6297
hash ! ( token:: get_name( p. name) ) ;
6330
6298
}
6331
- ty_open( _) => byte ! ( 22 ) ,
6332
6299
ty_infer( _) => unreachable ! ( ) ,
6333
- ty_err => byte ! ( 23 ) ,
6300
+ ty_err => byte ! ( 21 ) ,
6334
6301
ty_closure( d, r, _) => {
6335
- byte ! ( 24 ) ;
6302
+ byte ! ( 22 ) ;
6336
6303
did ( state, d) ;
6337
6304
region ( state, * r) ;
6338
6305
}
6339
6306
ty_projection( ref data) => {
6340
- byte ! ( 25 ) ;
6307
+ byte ! ( 23 ) ;
6341
6308
did ( state, data. trait_ref . def_id ) ;
6342
6309
hash ! ( token:: get_name( data. item_name) ) ;
6343
6310
}
@@ -6666,7 +6633,6 @@ pub fn accumulate_lifetimes_in_type(accumulator: &mut Vec<ty::Region>,
6666
6633
ty_projection( _) |
6667
6634
ty_param( _) |
6668
6635
ty_infer( _) |
6669
- ty_open( _) |
6670
6636
ty_err => {
6671
6637
}
6672
6638
}
0 commit comments