summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/remove_blank_lines.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/remove_blank_lines.rs')
-rw-r--r--src/tools/rustfmt/tests/target/remove_blank_lines.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/remove_blank_lines.rs b/src/tools/rustfmt/tests/target/remove_blank_lines.rs
new file mode 100644
index 000000000..de74c81ef
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/remove_blank_lines.rs
@@ -0,0 +1,28 @@
+fn main() {
+ let x = 1;
+
+ let y = 2;
+
+ println!("x + y = {}", x + y);
+}
+
+fn foo() {
+ #![attribute]
+
+ let x = 1;
+
+ // comment
+}
+// comment after item
+
+// comment before item
+fn bar() {
+ let x = 1;
+ // comment after statement
+
+ // comment before statement
+ let y = 2;
+ let z = 3;
+
+ println!("x + y + z = {}", x + y + z);
+}