summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/issue-4603.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/issue-4603.rs')
-rw-r--r--src/tools/rustfmt/tests/target/issue-4603.rs47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/issue-4603.rs b/src/tools/rustfmt/tests/target/issue-4603.rs
new file mode 100644
index 000000000..e8c368a24
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-4603.rs
@@ -0,0 +1,47 @@
+// Formatting when original macro snippet is used
+
+// Original issue #4603 code
+#![feature(or_patterns)]
+macro_rules! t_or_f {
+ () => {
+ (true // some comment
+ | false)
+ };
+}
+
+// Other test cases variations
+macro_rules! RULES {
+ () => {
+ (
+ xxxxxxx // COMMENT
+ | yyyyyyy
+ )
+ };
+}
+macro_rules! RULES {
+ () => {
+ (xxxxxxx // COMMENT
+ | yyyyyyy)
+ };
+}
+
+fn main() {
+ macro_rules! RULES {
+ () => {
+ (xxxxxxx // COMMENT
+ | yyyyyyy)
+ };
+ }
+}
+
+macro_rules! RULES {
+ () => {
+ (xxxxxxx /* COMMENT */ | yyyyyyy)
+ };
+}
+macro_rules! RULES {
+ () => {
+ (xxxxxxx /* COMMENT */
+ | yyyyyyy)
+ };
+}