]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/rustfmt/tests/source/array_comment.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / rustfmt / tests / source / array_comment.rs
diff --git a/src/tools/rustfmt/tests/source/array_comment.rs b/src/tools/rustfmt/tests/source/array_comment.rs
new file mode 100644 (file)
index 0000000..87372b2
--- /dev/null
@@ -0,0 +1,19 @@
+// Issue 2842
+// The comment should not make the last line shorter
+
+static XXX: [i8; 64] = [
+    1, // Comment
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+];
+
+static XXX: [i8; 64] = [
+    1,
+    // Comment
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+];
+
+static XXX: [i8; 64] = [
+    1,
+    // Comment
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+];