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