@@ -922,44 +922,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
922922 // (See `<ExitScopes as DropTreeBuilder>::link_entry_point`.)
923923 self . cfg . terminate ( drop_and_continue_block, source_info, TerminatorKind :: UnwindResume ) ;
924924
925- {
926- let this = & mut * self ;
927- let blocks = drops. build_mir :: < ExitScopes > ( & mut this. cfg , Some ( real_target) ) ;
928- //let is_coroutine = this.coroutine.is_some();
929-
930- /*// Link the exit drop tree to unwind drop tree.
931- if drops.drops.iter().any(|drop_node| drop_node.data.kind == DropKind::Value) {
932- let unwind_target = this.diverge_cleanup_target(region_scope, span);
933- let mut unwind_indices = IndexVec::from_elem_n(unwind_target, 1);
934- for (drop_idx, drop_node) in drops.drops.iter_enumerated().skip(1) {
935- match drop_node.data.kind {
936- DropKind::Storage | DropKind::ForLint => {
937- if is_coroutine {
938- let unwind_drop = this.scopes.unwind_drops.add_drop(
939- drop_node.data,
940- unwind_indices[drop_node.next],
941- );
942- unwind_indices.push(unwind_drop);
943- } else {
944- unwind_indices.push(unwind_indices[drop_node.next]);
945- }
946- }
947- DropKind::Value => {
948- let unwind_drop = this
949- .scopes
950- .unwind_drops
951- .add_drop(drop_node.data, unwind_indices[drop_node.next]);
952- this.scopes.unwind_drops.add_entry_point(
953- blocks[drop_idx].unwrap(),
954- unwind_indices[drop_node.next],
955- );
956- unwind_indices.push(unwind_drop);
957- }
958- }
959- }
960- }*/
961- blocks[ ROOT_NODE ] . map ( BasicBlock :: unit)
962- } ;
925+ self . build_exit_tree ( drops, region_scope, span, Some ( real_target) ) ;
963926
964927 return self . cfg . start_new_block ( ) . unit ( ) ;
965928 }
0 commit comments