about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src/build/scope.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-22 19:05:04 -0400
committerMichael Goulet <michael@errs.io>2024-09-22 19:11:29 -0400
commitc682aa162b0d41e21cc6748f4fecfe01efb69d1f (patch)
tree0c31b640e3faacfb187a1509e3da5d5b6ba0109c /compiler/rustc_mir_build/src/build/scope.rs
parent1173204b364841b51598744fc69d7c80be10f956 (diff)
downloadrust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.tar.gz
rust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.zip
Reformat using the new identifier sorting from rustfmt
Diffstat (limited to 'compiler/rustc_mir_build/src/build/scope.rs')
-rw-r--r--compiler/rustc_mir_build/src/build/scope.rs92
1 files changed, 36 insertions, 56 deletions
diff --git a/compiler/rustc_mir_build/src/build/scope.rs b/compiler/rustc_mir_build/src/build/scope.rs
index 693037d03e0..dfc82f705a8 100644
--- a/compiler/rustc_mir_build/src/build/scope.rs
+++ b/compiler/rustc_mir_build/src/build/scope.rs
@@ -92,7 +92,7 @@ use rustc_middle::thir::{ExprId, LintLevel};
 use rustc_middle::{bug, span_bug};
 use rustc_session::lint::Level;
 use rustc_span::source_map::Spanned;
-use rustc_span::{Span, DUMMY_SP};
+use rustc_span::{DUMMY_SP, Span};
 use tracing::{debug, instrument};
 
 use crate::build::{BlockAnd, BlockAndExtension, BlockFrame, Builder, CFG};
@@ -510,16 +510,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
             (Some(normal_block), Some(exit_block)) => {
                 let target = self.cfg.start_new_block();
                 let source_info = self.source_info(span);
-                self.cfg.terminate(
-                    normal_block.into_block(),
-                    source_info,
-                    TerminatorKind::Goto { target },
-                );
-                self.cfg.terminate(
-                    exit_block.into_block(),
-                    source_info,
-                    TerminatorKind::Goto { target },
-                );
+                self.cfg.terminate(normal_block.into_block(), source_info, TerminatorKind::Goto {
+                    target,
+                });
+                self.cfg.terminate(exit_block.into_block(), source_info, TerminatorKind::Goto {
+                    target,
+                });
                 target.unit()
             }
         }
@@ -806,25 +802,21 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                         unwind_drops.add_entry_point(block, unwind_entry_point);
 
                         let next = self.cfg.start_new_block();
-                        self.cfg.terminate(
-                            block,
-                            source_info,
-                            TerminatorKind::Drop {
-                                place: local.into(),
-                                target: next,
-                                unwind: UnwindAction::Continue,
-                                replace: false,
-                            },
-                        );
+                        self.cfg.terminate(block, source_info, TerminatorKind::Drop {
+                            place: local.into(),
+                            target: next,
+                            unwind: UnwindAction::Continue,
+                            replace: false,
+                        });
                         block = next;
                     }
                     DropKind::Storage => {
                         // Only temps and vars need their storage dead.
                         assert!(local.index() > self.arg_count);
-                        self.cfg.push(
-                            block,
-                            Statement { source_info, kind: StatementKind::StorageDead(local) },
-                        );
+                        self.cfg.push(block, Statement {
+                            source_info,
+                            kind: StatementKind::StorageDead(local),
+                        });
                     }
                 }
             }
@@ -1283,16 +1275,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
         let assign_unwind = self.cfg.start_new_cleanup_block();
         self.cfg.push_assign(assign_unwind, source_info, place, value.clone());
 
-        self.cfg.terminate(
-            block,
-            source_info,
-            TerminatorKind::Drop {
-                place,
-                target: assign,
-                unwind: UnwindAction::Cleanup(assign_unwind),
-                replace: true,
-            },
-        );
+        self.cfg.terminate(block, source_info, TerminatorKind::Drop {
+            place,
+            target: assign,
+            unwind: UnwindAction::Cleanup(assign_unwind),
+            replace: true,
+        });
         self.diverge_from(block);
 
         assign.unit()
@@ -1312,17 +1300,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
         let source_info = self.source_info(span);
         let success_block = self.cfg.start_new_block();
 
-        self.cfg.terminate(
-            block,
-            source_info,
-            TerminatorKind::Assert {
-                cond,
-                expected,
-                msg: Box::new(msg),
-                target: success_block,
-                unwind: UnwindAction::Continue,
-            },
-        );
+        self.cfg.terminate(block, source_info, TerminatorKind::Assert {
+            cond,
+            expected,
+            msg: Box::new(msg),
+            target: success_block,
+            unwind: UnwindAction::Continue,
+        });
         self.diverge_from(block);
 
         success_block
@@ -1397,16 +1381,12 @@ fn build_scope_drops<'tcx>(
                 unwind_drops.add_entry_point(block, unwind_to);
 
                 let next = cfg.start_new_block();
-                cfg.terminate(
-                    block,
-                    source_info,
-                    TerminatorKind::Drop {
-                        place: local.into(),
-                        target: next,
-                        unwind: UnwindAction::Continue,
-                        replace: false,
-                    },
-                );
+                cfg.terminate(block, source_info, TerminatorKind::Drop {
+                    place: local.into(),
+                    target: next,
+                    unwind: UnwindAction::Continue,
+                    replace: false,
+                });
                 block = next;
             }
             DropKind::Storage => {