diff options
| author | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2022-07-05 23:31:18 +0200 |
|---|---|---|
| committer | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2022-07-11 23:20:37 +0200 |
| commit | 1cd30e7b32df602cf455d34ff8042079b8e082a3 (patch) | |
| tree | 8e1718add47e77e23a2895a900767a5e44f38f25 /compiler/rustc_hir_pretty | |
| parent | 6c529ded8674b89c46052da92399227c3b764c6a (diff) | |
| download | rust-1cd30e7b32df602cf455d34ff8042079b8e082a3.tar.gz rust-1cd30e7b32df602cf455d34ff8042079b8e082a3.zip | |
move else block into the `Local` struct
Diffstat (limited to 'compiler/rustc_hir_pretty')
| -rw-r--r-- | compiler/rustc_hir_pretty/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 7f860130873..e3c97ec357e 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -915,8 +915,8 @@ impl<'a> State<'a> { pub fn print_stmt(&mut self, st: &hir::Stmt<'_>) { self.maybe_print_comment(st.span.lo()); match st.kind { - hir::StmtKind::Local(loc, els) => { - self.print_local(loc.init, els, |this| this.print_local_decl(loc)); + hir::StmtKind::Local(loc) => { + self.print_local(loc.init, loc.els, |this| this.print_local_decl(loc)); } hir::StmtKind::Item(item) => self.ann.nested(self, Nested::Item(item)), hir::StmtKind::Expr(expr) => { @@ -2305,7 +2305,7 @@ fn expr_requires_semi_to_be_stmt(e: &hir::Expr<'_>) -> bool { /// seen the semicolon, and thus don't need another. fn stmt_ends_with_semi(stmt: &hir::StmtKind<'_>) -> bool { match *stmt { - hir::StmtKind::Local(_, _) => true, + hir::StmtKind::Local(_) => true, hir::StmtKind::Item(_) => false, hir::StmtKind::Expr(e) => expr_requires_semi_to_be_stmt(e), hir::StmtKind::Semi(..) => false, |
