]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_expand/src/build.rs
Auto merge of #93700 - rossmacarthur:ft/iter-next-chunk, r=m-ou-se
[rust.git] / compiler / rustc_expand / src / build.rs
index 56d0263269b53daacc2ab974dd6e557143bdefdf..e73c31c98fe32040a4cd21aac375b43947e03a22 100644 (file)
@@ -160,7 +160,7 @@ pub fn stmt_let(&self, sp: Span, mutbl: bool, ident: Ident, ex: P<ast::Expr>) ->
             attrs: AttrVec::new(),
             tokens: None,
         });
-        ast::Stmt { id: ast::DUMMY_NODE_ID, kind: ast::StmtKind::Local(local), span: sp }
+        self.stmt_local(local, sp)
     }
 
     // Generates `let _: Type;`, which is usually used for type assertions.
@@ -174,6 +174,10 @@ pub fn stmt_let_type_only(&self, span: Span, ty: P<ast::Ty>) -> ast::Stmt {
             attrs: AttrVec::new(),
             tokens: None,
         });
+        self.stmt_local(local, span)
+    }
+
+    pub fn stmt_local(&self, local: P<ast::Local>, span: Span) -> ast::Stmt {
         ast::Stmt { id: ast::DUMMY_NODE_ID, kind: ast::StmtKind::Local(local), span }
     }