about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/transform
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2023-07-12 21:49:27 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2023-07-12 21:49:27 -0400
commitcc907f80b95c6ec530c5ee1b05b044a468f07eca (patch)
tree47015a30be181fdb089b7daa4b8f18e9bb1d62f2 /compiler/rustc_const_eval/src/transform
parent67b0cfc761c9ad31a1dbacca36c42803b255f17a (diff)
downloadrust-cc907f80b95c6ec530c5ee1b05b044a468f07eca.tar.gz
rust-cc907f80b95c6ec530c5ee1b05b044a468f07eca.zip
Re-format let-else per rustfmt update
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/check.rs3
-rw-r--r--compiler/rustc_const_eval/src/transform/promote_consts.rs10
-rw-r--r--compiler/rustc_const_eval/src/transform/validate.rs17
3 files changed, 16 insertions, 14 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs
index 14540e8dfe7..fa71606eeb2 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs
@@ -778,8 +778,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                             if trait_ref.self_ty().is_closure()
                                 && tcx.fn_trait_kind_from_def_id(trait_id).is_some() =>
                         {
-                            let ty::Closure(closure_def_id, substs) =
-                                *trait_ref.self_ty().kind()
+                            let ty::Closure(closure_def_id, substs) = *trait_ref.self_ty().kind()
                             else {
                                 unreachable!()
                             };
diff --git a/compiler/rustc_const_eval/src/transform/promote_consts.rs b/compiler/rustc_const_eval/src/transform/promote_consts.rs
index 1b39a76e460..0df110f8fbe 100644
--- a/compiler/rustc_const_eval/src/transform/promote_consts.rs
+++ b/compiler/rustc_const_eval/src/transform/promote_consts.rs
@@ -759,11 +759,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
             let (mut rvalue, source_info) = {
                 let statement = &mut self.source[loc.block].statements[loc.statement_index];
                 let StatementKind::Assign(box (_, rhs)) = &mut statement.kind else {
-                    span_bug!(
-                        statement.source_info.span,
-                        "{:?} is not an assignment",
-                        statement
-                    );
+                    span_bug!(statement.source_info.span, "{:?} is not an assignment", statement);
                 };
 
                 (
@@ -859,7 +855,9 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
             let local_decls = &mut self.source.local_decls;
             let loc = candidate.location;
             let statement = &mut blocks[loc.block].statements[loc.statement_index];
-            let StatementKind::Assign(box (_, Rvalue::Ref(region, borrow_kind, place))) = &mut statement.kind else {
+            let StatementKind::Assign(box (_, Rvalue::Ref(region, borrow_kind, place))) =
+                &mut statement.kind
+            else {
                 bug!()
             };
 
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs
index 4cc923cd935..e516145894b 100644
--- a/compiler/rustc_const_eval/src/transform/validate.rs
+++ b/compiler/rustc_const_eval/src/transform/validate.rs
@@ -214,9 +214,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
             stack.clear();
             stack.insert(bb);
             loop {
-                let Some(parent)= parent[bb].take() else {
-                    break
-                };
+                let Some(parent) = parent[bb].take() else { break };
                 let no_cycle = stack.insert(parent);
                 if !no_cycle {
                     self.fail(
@@ -399,7 +397,10 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             };
 
                             let Some(layout) = gen_body.generator_layout() else {
-                                self.fail(location, format!("No generator layout for {:?}", parent_ty));
+                                self.fail(
+                                    location,
+                                    format!("No generator layout for {:?}", parent_ty),
+                                );
                                 return;
                             };
 
@@ -409,13 +410,17 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             };
 
                             let Some(f_ty) = layout.field_tys.get(local) else {
-                                self.fail(location, format!("Out of bounds local {:?} for {:?}", local, parent_ty));
+                                self.fail(
+                                    location,
+                                    format!("Out of bounds local {:?} for {:?}", local, parent_ty),
+                                );
                                 return;
                             };
 
                             f_ty.ty
                         } else {
-                            let Some(f_ty) = substs.as_generator().prefix_tys().nth(f.index()) else {
+                            let Some(f_ty) = substs.as_generator().prefix_tys().nth(f.index())
+                            else {
                                 fail_out_of_bounds(self, location);
                                 return;
                             };