summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs')
-rw-r--r--src/tools/rustfmt/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs b/src/tools/rustfmt/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs
new file mode 100644
index 000000000..38fd6f02c
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs
@@ -0,0 +1,44 @@
+// rustfmt-struct_field_align_threshold: 30
+
+struct X {
+ a: i32,
+ b: i32,
+ c: i32,
+ d: i32,
+ e: i32,
+ f: i32,
+ g: i32,
+ h: i32,
+ i: i32,
+ j: i32,
+ k: i32,
+}
+
+fn test(x: X) {
+ let d = {
+ let e = {
+ let f = {
+ let g = {
+ let h = {
+ let i = {
+ let j = {
+ matches!(
+ x,
+ X {
+ a: 1_000, b: 1_000, c: 1_000, d: 1_000, e: 1_000, f: 1_000, g: 1_000, h: 1_000, i: 1_000, j: 1_000, ..
+ }
+ )
+ };
+ j
+ };
+ i
+ };
+ h
+ };
+ g
+ };
+ f
+ };
+ e
+ };
+}