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