]> git.lizzy.rs Git - rust.git/blobdiff - src/closures.rs
Merge pull request #3266 from wada314/fix-2973
[rust.git] / src / closures.rs
index fa656cc351eea68c857d6bbe8ce99cdd3acaa384..e29a412a5154491fa19524530420ca770345ee97 100644 (file)
@@ -20,7 +20,7 @@
 use rewrite::{Rewrite, RewriteContext};
 use shape::Shape;
 use source_map::SpanUtils;
-use utils::{last_line_width, left_most_sub_expr, stmt_expr};
+use utils::{last_line_width, left_most_sub_expr, stmt_expr, NodeIdExt};
 
 // This module is pretty messy because of the rules around closures and blocks:
 // FIXME - the below is probably no longer true in full.
@@ -150,11 +150,11 @@ fn rewrite_closure_with_block(
 
     let block = ast::Block {
         stmts: vec![ast::Stmt {
-            id: ast::NodeId::new(0),
+            id: ast::NodeId::root(),
             node: ast::StmtKind::Expr(ptr::P(body.clone())),
             span: body.span,
         }],
-        id: ast::NodeId::new(0),
+        id: ast::NodeId::root(),
         rules: ast::BlockCheckMode::Default,
         span: body.span,
         recovered: false,