summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/array_comment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/source/array_comment.rs')
-rw-r--r--src/tools/rustfmt/tests/source/array_comment.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/array_comment.rs b/src/tools/rustfmt/tests/source/array_comment.rs
new file mode 100644
index 000000000..87372b279
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/array_comment.rs
@@ -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,
+];