summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/issue-5009
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/issue-5009')
-rw-r--r--src/tools/rustfmt/tests/target/issue-5009/1_minimum_example.rs4
-rw-r--r--src/tools/rustfmt/tests/target/issue-5009/2_many_in_connectors_in_pattern.rs3
-rw-r--r--src/tools/rustfmt/tests/target/issue-5009/3_nested_for_loop_with_connector_in_pattern.rs5
-rw-r--r--src/tools/rustfmt/tests/target/issue-5009/4_nested_for_loop_with_if_elseif_else.rs13
-rw-r--r--src/tools/rustfmt/tests/target/issue-5009/5_nested_for_loop_with_connector_in_if_elseif_else.rs15
-rw-r--r--src/tools/rustfmt/tests/target/issue-5009/6_deeply_nested_for_loop_with_connector_in_pattern.rs32
6 files changed, 72 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/issue-5009/1_minimum_example.rs b/src/tools/rustfmt/tests/target/issue-5009/1_minimum_example.rs
new file mode 100644
index 000000000..55836f4bf
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-5009/1_minimum_example.rs
@@ -0,0 +1,4 @@
+fn main() {
+ // the "in" inside the pattern produced invalid syntax
+ for variable_in_here /* ... */ in 0..1 {}
+}
diff --git a/src/tools/rustfmt/tests/target/issue-5009/2_many_in_connectors_in_pattern.rs b/src/tools/rustfmt/tests/target/issue-5009/2_many_in_connectors_in_pattern.rs
new file mode 100644
index 000000000..d83590c68
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-5009/2_many_in_connectors_in_pattern.rs
@@ -0,0 +1,3 @@
+fn main() {
+ for in_in_in_in_in_in_in_in /* ... */ in 0..1 {}
+}
diff --git a/src/tools/rustfmt/tests/target/issue-5009/3_nested_for_loop_with_connector_in_pattern.rs b/src/tools/rustfmt/tests/target/issue-5009/3_nested_for_loop_with_connector_in_pattern.rs
new file mode 100644
index 000000000..9c8007239
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-5009/3_nested_for_loop_with_connector_in_pattern.rs
@@ -0,0 +1,5 @@
+fn main() {
+ for variable_in_x /* ... */ in 0..1 {
+ for variable_in_y /* ... */ in 0..1 {}
+ }
+}
diff --git a/src/tools/rustfmt/tests/target/issue-5009/4_nested_for_loop_with_if_elseif_else.rs b/src/tools/rustfmt/tests/target/issue-5009/4_nested_for_loop_with_if_elseif_else.rs
new file mode 100644
index 000000000..a716d0d30
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-5009/4_nested_for_loop_with_if_elseif_else.rs
@@ -0,0 +1,13 @@
+fn main() {
+ for variable_in_x /* ... */ in 0..1 {
+ for variable_in_y /* ... */ in 0..1 {
+ if false {
+
+ } else if false {
+
+ } else {
+
+ }
+ }
+ }
+}
diff --git a/src/tools/rustfmt/tests/target/issue-5009/5_nested_for_loop_with_connector_in_if_elseif_else.rs b/src/tools/rustfmt/tests/target/issue-5009/5_nested_for_loop_with_connector_in_if_elseif_else.rs
new file mode 100644
index 000000000..41ea46d4c
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-5009/5_nested_for_loop_with_connector_in_if_elseif_else.rs
@@ -0,0 +1,15 @@
+fn main() {
+ let in_ = false;
+
+ for variable_in_x /* ... */ in 0..1 {
+ for variable_in_y /* ... */ in 0..1 {
+ if in_ {
+
+ } else if in_ {
+
+ } else {
+
+ }
+ }
+ }
+}
diff --git a/src/tools/rustfmt/tests/target/issue-5009/6_deeply_nested_for_loop_with_connector_in_pattern.rs b/src/tools/rustfmt/tests/target/issue-5009/6_deeply_nested_for_loop_with_connector_in_pattern.rs
new file mode 100644
index 000000000..789e54f7e
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-5009/6_deeply_nested_for_loop_with_connector_in_pattern.rs
@@ -0,0 +1,32 @@
+fn main() {
+ for variable_in_a /* ... */ in 0..1 {
+ for variable_in_b /* ... */ in 0..1 {
+ for variable_in_c /* ... */ in 0..1 {
+ for variable_in_d /* ... */ in 0..1 {
+ for variable_in_e /* ... */ in 0..1 {
+ for variable_in_f /* ... */ in 0..1 {
+ for variable_in_g /* ... */ in 0..1 {
+ for variable_in_h /* ... */ in 0..1 {
+ for variable_in_i /* ... */ in 0..1 {
+ for variable_in_j /* ... */ in 0..1 {
+ for variable_in_k /* ... */ in 0..1 {
+ for variable_in_l /* ... */ in 0..1 {
+ for variable_in_m /* ... */ in 0..1 {
+ for variable_in_n /* ... */ in 0..1 {
+ for variable_in_o /* ... */ in 0..1 {
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}