]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/hir/mod.rs
Auto merge of #53815 - F001:if-let-guard, r=petrochenkov
[rust.git] / src / librustc / hir / mod.rs
index 7ac334d84a9bfdd2401f6f5734a044f4d4f7aad0..1b3103578737190b2c32a3886806940a6022af92 100644 (file)
@@ -1204,10 +1204,15 @@ pub fn is_local(&self) -> bool {
 pub struct Arm {
     pub attrs: HirVec<Attribute>,
     pub pats: HirVec<P<Pat>>,
-    pub guard: Option<P<Expr>>,
+    pub guard: Option<Guard>,
     pub body: P<Expr>,
 }
 
+#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
+pub enum Guard {
+    If(P<Expr>),
+}
+
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct Field {
     pub id: NodeId,