about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-06-24 05:00:10 +0000
committerbors <bors@rust-lang.org>2019-06-24 05:00:10 +0000
commit3cc34867339356a34428e9ec3efa618d86228fed (patch)
treebbfaf3093c4a894726e09107b8d385225c40795e /src/libsyntax/print/pprust.rs
parent85ed21e83c9f42203cfe06d41eab3f160bd13518 (diff)
parent4d537141835f825892e2be868620e98585b3d4a9 (diff)
downloadrust-3cc34867339356a34428e9ec3efa618d86228fed.tar.gz
rust-3cc34867339356a34428e9ec3efa618d86228fed.zip
Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkov
Remove `ast::Guard`

With the introduction of `ast::ExprKind::Let` in https://github.com/rust-lang/rust/pull/60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](https://github.com/rust-lang/rust/issues/51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here.

However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...).

r? @petrochenkov
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
-rw-r--r--src/libsyntax/print/pprust.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 164fe2f36e1..3f059927e57 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -2653,14 +2653,10 @@ impl<'a> State<'a> {
         self.print_outer_attributes(&arm.attrs)?;
         self.print_pats(&arm.pats)?;
         self.s.space()?;
-        if let Some(ref g) = arm.guard {
-            match g {
-                ast::Guard::If(ref e) => {
-                    self.word_space("if")?;
-                    self.print_expr(e)?;
-                    self.s.space()?;
-                }
-            }
+        if let Some(ref e) = arm.guard {
+            self.word_space("if")?;
+            self.print_expr(e)?;
+            self.s.space()?;
         }
         self.word_space("=>")?;