@@ -56,12 +56,8 @@ def_type_content_sets! {
5656 // InteriorAll = 0b00000000__00000000__1111,
5757
5858 // Things that are owned by the value (second and third nibbles):
59- OwnsOwned = 0b0000_0000__0000_0001__0000 ,
6059 OwnsDtor = 0b0000_0000__0000_0010__0000 ,
61- OwnsAll = 0b0000_0000__1111_1111__0000 ,
62-
63- // Things that mean drop glue is necessary
64- NeedsDrop = 0b0000_0000__0000_0111__0000 ,
60+ // OwnsAll = 0b0000_0000__1111_1111__0000,
6561
6662 // All bits
6763 All = 0b1111_1111__1111_1111__1111
@@ -77,10 +73,6 @@ impl TypeContents {
7773 ( self . bits & tc. bits ) != 0
7874 }
7975
80- pub fn owns_owned ( & self ) -> bool {
81- self . intersects ( TC :: OwnsOwned )
82- }
83-
8476 pub fn interior_param ( & self ) -> bool {
8577 self . intersects ( TC :: InteriorParam )
8678 }
@@ -90,12 +82,7 @@ impl TypeContents {
9082 }
9183
9284 pub fn needs_drop ( & self , _: TyCtxt ) -> bool {
93- self . intersects ( TC :: NeedsDrop )
94- }
95-
96- /// Includes only those bits that still apply when indirected through a `Box` pointer
97- pub fn owned_pointer ( & self ) -> TypeContents {
98- TC :: OwnsOwned | ( * self & TC :: OwnsAll )
85+ self . intersects ( TC :: OwnsDtor )
9986 }
10087
10188 pub fn union < I , T , F > ( v : I , mut f : F ) -> TypeContents where
@@ -104,10 +91,6 @@ impl TypeContents {
10491 {
10592 v. into_iter ( ) . fold ( TC :: None , |tc, ty| tc | f ( ty) )
10693 }
107-
108- pub fn has_dtor ( & self ) -> bool {
109- self . intersects ( TC :: OwnsDtor )
110- }
11194}
11295
11396impl ops:: BitOr for TypeContents {
@@ -191,10 +174,6 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
191174 TC :: None
192175 }
193176
194- ty:: TyBox ( typ) => {
195- tc_ty ( tcx, typ, cache) . owned_pointer ( )
196- }
197-
198177 ty:: TyDynamic ( ..) => {
199178 TC :: All - TC :: InteriorParam
200179 }
@@ -237,7 +216,7 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
237216
238217 if def. is_union ( ) {
239218 // unions don't have destructors regardless of the child types
240- res = res - TC :: NeedsDrop ;
219+ res = res - TC :: OwnsDtor ;
241220 }
242221
243222 if def. has_dtor ( ) {
0 commit comments