summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/issue_5691.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/issue_5691.rs')
-rw-r--r--src/tools/rustfmt/tests/target/issue_5691.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/issue_5691.rs b/src/tools/rustfmt/tests/target/issue_5691.rs
new file mode 100644
index 000000000..e3aad15db
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue_5691.rs
@@ -0,0 +1,16 @@
+struct S<const C: usize>
+where
+ [(); { num_slots!(C) }]:, {
+ /* An asterisk-based, or a double-slash-prefixed, comment here is
+ required to trigger the fmt bug.
+
+ A single-line triple-slash-prefixed comment (with a field following it) is not enough - it will not trigger the fmt bug.
+
+ Side note: If you have a combination of two, or all three of the
+ above mentioned types of comments here, some of them disappear
+ after `cargo fmt`.
+
+ The bug gets triggered even if a field definition following the
+ (asterisk-based, or a double-slash-prefixed) comment, too.
+ */
+}