File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -761,16 +761,17 @@ where
761
761
762
762
let skip_contents = adt. is_union ( ) || adt. is_manually_drop ( ) ;
763
763
let contents_drop = if skip_contents {
764
- if adt. has_dtor ( self . tcx ( ) ) {
764
+ if adt. has_dtor ( self . tcx ( ) ) && self . elaborator . get_drop_flag ( self . path ) . is_some ( ) {
765
765
// the top-level drop flag is usually cleared by open_drop_for_adt_contents
766
- // types with destructors still need an empty drop ladder to clear it
766
+ // types with destructors would still need an empty drop ladder to clear it
767
767
768
- // currently no rust types can trigger this path in a context where drop flags exist
769
- // however, a future box-like "DerefMove" trait would allow it
770
- self . drop_ladder_bottom ( )
771
- } else {
772
- ( self . succ , self . unwind , self . dropline )
768
+ // however, these types are only open dropped in `DropShimElaborator`
769
+ // which does not have drop flags
770
+ // a future box-like "DerefMove" trait would allow for this case to happen
771
+ span_bug ! ( self . source_info. span, "open dropping partially moved union" ) ;
773
772
}
773
+
774
+ ( self . succ , self . unwind , self . dropline )
774
775
} else {
775
776
self . open_drop_for_adt_contents ( adt, args)
776
777
} ;
You can’t perform that action at this time.
0 commit comments