about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-03-23 03:53:06 +0000
committerbors <bors@rust-lang.org>2017-03-23 03:53:06 +0000
commit7c7753d370ee186219bf369cb0910a20198ea79e (patch)
tree7447808378b144534bdac51dce3a48670cda23a9 /src/libsyntax/ext
parentc62e532f3de4c0254b772c36fe629b2042efd107 (diff)
parent93074187b6c7aeeec6a8fd28574bfad7a4608e1f (diff)
downloadrust-7c7753d370ee186219bf369cb0910a20198ea79e.tar.gz
rust-7c7753d370ee186219bf369cb0910a20198ea79e.zip
Auto merge of #40752 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests

- Successful merges: #39891, #40518, #40542, #40617, #40678, #40696
- Failed merges:
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/placeholders.rs14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/libsyntax/ext/placeholders.rs b/src/libsyntax/ext/placeholders.rs
index f60b1d17a5e..f0e328a551d 100644
--- a/src/libsyntax/ext/placeholders.rs
+++ b/src/libsyntax/ext/placeholders.rs
@@ -178,17 +178,9 @@ impl<'a, 'b> Folder for PlaceholderExpander<'a, 'b> {
             block.stmts = block.stmts.move_flat_map(|mut stmt| {
                 remaining_stmts -= 1;
 
-                match stmt.node {
-                    // Avoid wasting a node id on a trailing expression statement,
-                    // which shares a HIR node with the expression itself.
-                    ast::StmtKind::Expr(ref expr) if remaining_stmts == 0 => stmt.id = expr.id,
-
-                    _ if self.monotonic => {
-                        assert_eq!(stmt.id, ast::DUMMY_NODE_ID);
-                        stmt.id = self.cx.resolver.next_node_id();
-                    }
-
-                    _ => {}
+                if self.monotonic {
+                    assert_eq!(stmt.id, ast::DUMMY_NODE_ID);
+                    stmt.id = self.cx.resolver.next_node_id();
                 }
 
                 Some(stmt)