]> git.lizzy.rs Git - rust.git/commitdiff
Handle semicolons in macro statements
authorNick Cameron <ncameron@mozilla.com>
Tue, 17 Jan 2017 21:38:46 +0000 (10:38 +1300)
committerNick Cameron <ncameron@mozilla.com>
Tue, 17 Jan 2017 21:38:46 +0000 (10:38 +1300)
Fixes #1279

src/visitor.rs
tests/source/macros.rs
tests/target/macros.rs

index f568c63eb3811aa80b4d95f9a8b73a5224856b39..bea976523bbb1bb54f1b6efd25ce528392776dc2 100644 (file)
@@ -61,12 +61,12 @@ fn visit_stmt(&mut self, stmt: &ast::Stmt) {
                 let rewrite = stmt.rewrite(&self.get_context(),
                                            self.config.max_width - self.block_indent.width(),
                                            self.block_indent);
-
                 self.push_rewrite(stmt.span, rewrite);
             }
             ast::StmtKind::Mac(ref mac) => {
                 let (ref mac, _macro_style, _) = **mac;
                 self.visit_mac(mac, None, MacroPosition::Statement);
+                self.format_missing(stmt.span.hi);
             }
         }
     }
index 1c4fd138820556feab779a92b4987f4c0bf5de8b..c8f625b935b0b2e51f3a23bf98c67f13b05fb4fd 100644 (file)
@@ -75,3 +75,7 @@ impl X {
     vbuf: gfx::VertexBuffer<Vertex> = (),
     out: gfx::RenderTarget<ColorFormat> = "Target0",
 });
+
+fn issue_1279() {
+    println!("dsfs"); // a comment
+}
index 66bf4d33a982deaf1629ae58d0f0757dc046ebf8..c4f40cfe55b338916b08ed685223f01d9cd02540 100644 (file)
@@ -76,3 +76,7 @@ impl X {
     vbuf: gfx::VertexBuffer<Vertex> = (),
     out: gfx::RenderTarget<ColorFormat> = "Target0",
 });
+
+fn issue_1279() {
+    println!("dsfs"); // a comment
+}