diff --git a/src/items.rs b/src/items.rs index dc3abd88ffd8..30f3d6f4be45 100644 --- a/src/items.rs +++ b/src/items.rs @@ -1281,17 +1281,10 @@ fn format_tuple_struct( } result.push(')'); } else { - // 1 = "," - let body = rewrite_call_inner( - context, - "", - &fields.iter().map(|field| field).collect::>()[..], - span, - Shape::indented(offset, context.config).sub_width(1)?, - context.config.fn_call_width(), - false, - )?; - result.push_str(&body); + let shape = Shape::indented(offset, context.config); + let fields = &fields.iter().map(|field| field).collect::>()[..]; + let one_line_width = context.config.fn_call_width(); + result = rewrite_call_inner(context, &result, fields, span, shape, one_line_width, false)?; } if !where_clause_str.is_empty() && !where_clause_str.contains('\n') diff --git a/tests/source/structs.rs b/tests/source/structs.rs index acae17befdd4..6dfb565e80bf 100644 --- a/tests/source/structs.rs +++ b/tests/source/structs.rs @@ -266,3 +266,6 @@ pub(crate) struct Foo{} pub(in self) struct Foo(); pub(super) struct Foo(); pub(crate) struct Foo(); + +// #2125 +pub struct ReadinessCheckRegistry(Mutex, Box ReadinessCheck + Sync + Send>>>); diff --git a/tests/target/structs.rs b/tests/target/structs.rs index e29647c71fbb..1628c96f5552 100644 --- a/tests/target/structs.rs +++ b/tests/target/structs.rs @@ -308,3 +308,8 @@ pub(crate) struct Foo {} pub(self) struct Foo(); pub(super) struct Foo(); pub(crate) struct Foo(); + +// #2125 +pub struct ReadinessCheckRegistry( + Mutex, Box ReadinessCheck + Sync + Send>>>, +);