From 74259ffc47bf65d1d54da1e505f8ec230c7ef536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Wed, 22 May 2019 22:48:22 +0200 Subject: [PATCH 1/9] Improve documentation of the Density::Tall variant and remove unnecessary condition --- src/config/options.rs | 2 +- src/lists.rs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/config/options.rs b/src/config/options.rs index 72acaacd348..163e59ad78c 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -61,7 +61,7 @@ pub enum IndentStyle { pub enum Density { /// Fit as much on one line as possible. Compressed, - /// Use more lines. + /// Items are placed horizontally if sufficient space, vertically otherwise. Tall, /// Place every item on a separate line. Vertical, diff --git a/src/lists.rs b/src/lists.rs index f57a78f9874..428a0eab9b0 100644 --- a/src/lists.rs +++ b/src/lists.rs @@ -246,10 +246,7 @@ where let total_sep_len = sep.len() * sep_count.saturating_sub(1); let real_total = total_width + total_sep_len; - if real_total <= limit - && !pre_line_comments - && !items.into_iter().any(|item| item.as_ref().is_multiline()) - { + if real_total <= limit && !items.into_iter().any(|item| item.as_ref().is_multiline()) { DefinitiveListTactic::Horizontal } else { match tactic { From 7cd7f525e7fee85a95d862d10d7d5e7ce86cc864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Wed, 22 May 2019 22:49:52 +0200 Subject: [PATCH 2/9] replace where density with the boolean on_new_line The density parameter of items::rewrite_where_clause was used only in a conditional, which evaluated to true only if the parameter was Density::Tall. --- src/items.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/items.rs b/src/items.rs index 7640fa32d22..752d6d01580 100644 --- a/src/items.rs +++ b/src/items.rs @@ -15,7 +15,7 @@ use crate::comment::{ FindUncommented, }; use crate::config::lists::*; -use crate::config::{BraceStyle, Config, Density, IndentStyle, Version}; +use crate::config::{BraceStyle, Config, IndentStyle, Version}; use crate::expr::{ format_expr, is_empty_block, is_simple_block_stmt, rewrite_assign_rhs, rewrite_assign_rhs_with, ExprType, RhsTactics, @@ -703,7 +703,7 @@ pub(crate) fn format_impl( &generics.where_clause, context.config.brace_style(), Shape::legacy(where_budget, offset.block_only()), - Density::Vertical, + false, "{", where_span_end, self_ty.span.hi(), @@ -1044,11 +1044,7 @@ pub(crate) fn format_trait( // Rewrite where-clause. if !generics.where_clause.predicates.is_empty() { - let where_density = if context.config.indent_style() == IndentStyle::Block { - Density::Compressed - } else { - Density::Tall - }; + let where_on_new_line = context.config.indent_style() != IndentStyle::Block; let where_budget = context.budget(last_line_width(&result)); let pos_before_where = if generic_bounds.is_empty() { @@ -1062,7 +1058,7 @@ pub(crate) fn format_trait( &generics.where_clause, context.config.brace_style(), Shape::legacy(where_budget, offset.block_only()), - where_density, + where_on_new_line, "{", None, pos_before_where, @@ -1423,7 +1419,7 @@ fn format_tuple_struct( &generics.where_clause, context.config.brace_style(), Shape::legacy(where_budget, offset.block_only()), - Density::Compressed, + false, ";", None, body_hi, @@ -1499,7 +1495,7 @@ fn rewrite_type_prefix( &generics.where_clause, context.config.brace_style(), Shape::legacy(where_budget, indent), - Density::Vertical, + false, "=", None, generics.span.hi(), @@ -2258,7 +2254,7 @@ fn rewrite_fn_base( where_clause, context.config.brace_style(), Shape::indented(indent, context.config), - Density::Tall, + true, "{", Some(span.hi()), pos_before_where, @@ -2677,7 +2673,7 @@ fn rewrite_where_clause( where_clause: &ast::WhereClause, brace_style: BraceStyle, shape: Shape, - density: Density, + on_new_line: bool, terminator: &str, span_end: Option, span_end_before_where: BytePos, @@ -2757,7 +2753,7 @@ fn rewrite_where_clause( } else { terminator.len() }; - if density == Density::Tall + if on_new_line || preds_str.contains('\n') || shape.indent.width() + " where ".len() + preds_str.len() + end_length > shape.width { @@ -2848,7 +2844,7 @@ fn format_generics( &generics.where_clause, brace_style, Shape::legacy(budget, offset.block_only()), - Density::Tall, + true, "{", Some(span.hi()), span_end_before_where, From 43e0a938a448dbdaa732c1a448c40814e431057b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Wed, 22 May 2019 22:52:31 +0200 Subject: [PATCH 3/9] stabilise fn_args_density configuration option --- Configurations.md | 2 +- src/config/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Configurations.md b/Configurations.md index 3737b1c9a4e..26f87095cf3 100644 --- a/Configurations.md +++ b/Configurations.md @@ -635,7 +635,7 @@ Argument density in functions - **Default value**: `"Tall"` - **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"` -- **Stable**: No (tracking issue: #3375) +- **Stable**: Yes #### `"Tall"` (default): diff --git a/src/config/mod.rs b/src/config/mod.rs index eaa6d012d5b..e94cc9e9b08 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -92,7 +92,7 @@ create_config! { the same line with the pattern of arms"; force_multiline_blocks: bool, false, false, "Force multiline closure bodies and match arms to be wrapped in a block"; - fn_args_density: Density, Density::Tall, false, "Argument density in functions"; + fn_args_density: Density, Density::Tall, true, "Argument density in functions"; brace_style: BraceStyle, BraceStyle::SameLineWhere, false, "Brace style for items"; control_brace_style: ControlBraceStyle, ControlBraceStyle::AlwaysSameLine, false, "Brace style for control flow constructs"; From 2a915bb5cc7c6821e62db6dec293d146d6483239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Wed, 22 May 2019 23:59:16 +0200 Subject: [PATCH 4/9] update changelog with new stabilisation --- CHANGELOG.md | 3 +++ Processes.md | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 836b2fd81a1..d55320fff3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,12 @@ ## [Unreleased] +### Changed + - Change option `format_doc_comment` to `format_code_in_doc_comment`. - `use_small_heuristics` changed to be an enum and stabilised. Configuration options are now ready for 1.0. +- Stabilise `fn_args_density` configuration option #3581 ## [1.2.2] 2019-04-24 diff --git a/Processes.md b/Processes.md index 3f1c07c52b3..9d86d52b122 100644 --- a/Processes.md +++ b/Processes.md @@ -17,6 +17,7 @@ Open a pull request that closes the tracking issue. The tracking issue is listed - Update the `Config` enum marking the option as stable. - Update the the `Configuration.md` file marking the option as stable. +- Update `CHANGELOG.md` marking the option as stable. ## After the stabilisation From 2a35604c19cad7afb677af3bcf1ec95cbe1716a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Thu, 30 May 2019 09:57:08 +0200 Subject: [PATCH 5/9] rename fn_args_density configuration option to fn_args_layout --- CHANGELOG.md | 2 +- Configurations.md | 2 +- src/config/mod.rs | 4 ++-- src/items.rs | 2 +- tests/config/small_tabs.toml | 2 +- .../configs/{fn_args_density => fn_args_layout}/compressed.rs | 2 +- .../configs/{fn_args_density => fn_args_layout}/tall.rs | 2 +- .../configs/{fn_args_density => fn_args_layout}/vertical.rs | 2 +- tests/source/fn-custom-7.rs | 2 +- tests/source/fn-custom.rs | 2 +- ...fn_args_density-vertical.rs => fn_args_layout-vertical.rs} | 2 +- .../configs/{fn_args_density => fn_args_layout}/compressed.rs | 2 +- .../configs/{fn_args_density => fn_args_layout}/tall.rs | 2 +- .../configs/{fn_args_density => fn_args_layout}/vertical.rs | 2 +- tests/target/fn-custom-7.rs | 2 +- tests/target/fn-custom.rs | 2 +- ...fn_args_density-vertical.rs => fn_args_layout-vertical.rs} | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) rename tests/source/configs/{fn_args_density => fn_args_layout}/compressed.rs (92%) rename tests/source/configs/{fn_args_density => fn_args_layout}/tall.rs (93%) rename tests/source/configs/{fn_args_density => fn_args_layout}/vertical.rs (92%) rename tests/source/{fn_args_density-vertical.rs => fn_args_layout-vertical.rs} (96%) rename tests/target/configs/{fn_args_density => fn_args_layout}/compressed.rs (93%) rename tests/target/configs/{fn_args_density => fn_args_layout}/tall.rs (94%) rename tests/target/configs/{fn_args_density => fn_args_layout}/vertical.rs (94%) rename tests/target/{fn_args_density-vertical.rs => fn_args_layout-vertical.rs} (96%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d55320fff3b..be4e6c42074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - Change option `format_doc_comment` to `format_code_in_doc_comment`. - `use_small_heuristics` changed to be an enum and stabilised. Configuration options are now ready for 1.0. -- Stabilise `fn_args_density` configuration option #3581 +- Stabilise `fn_args_density` configuration option and rename it to `fn_args_layout` #3581 ## [1.2.2] 2019-04-24 diff --git a/Configurations.md b/Configurations.md index 26f87095cf3..6e0d2f21b6f 100644 --- a/Configurations.md +++ b/Configurations.md @@ -629,7 +629,7 @@ trailing whitespaces. - **Possible values**: `true`, `false` - **Stable**: No (tracking issue: #3392) -## `fn_args_density` +## `fn_args_layout` Argument density in functions diff --git a/src/config/mod.rs b/src/config/mod.rs index e94cc9e9b08..0142b73f9e1 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -92,7 +92,7 @@ create_config! { the same line with the pattern of arms"; force_multiline_blocks: bool, false, false, "Force multiline closure bodies and match arms to be wrapped in a block"; - fn_args_density: Density, Density::Tall, true, "Argument density in functions"; + fn_args_layout: Density, Density::Tall, true, "Argument density in functions"; brace_style: BraceStyle, BraceStyle::SameLineWhere, false, "Brace style for items"; control_brace_style: ControlBraceStyle, ControlBraceStyle::AlwaysSameLine, false, "Brace style for control flow constructs"; @@ -501,7 +501,7 @@ struct_field_align_threshold = 0 enum_discrim_align_threshold = 0 match_arm_blocks = true force_multiline_blocks = false -fn_args_density = "Tall" +fn_args_layout = "Tall" brace_style = "SameLineWhere" control_brace_style = "AlwaysSameLine" trailing_semicolon = true diff --git a/src/items.rs b/src/items.rs index 752d6d01580..75fab85f47e 100644 --- a/src/items.rs +++ b/src/items.rs @@ -2386,7 +2386,7 @@ fn rewrite_args( &arg_items, context .config - .fn_args_density() + .fn_args_layout() .to_list_tactic(arg_items.len()), Separator::Comma, one_line_budget, diff --git a/tests/config/small_tabs.toml b/tests/config/small_tabs.toml index d03ac281acb..35c8fd86467 100644 --- a/tests/config/small_tabs.toml +++ b/tests/config/small_tabs.toml @@ -3,7 +3,7 @@ comment_width = 80 tab_spaces = 2 newline_style = "Unix" brace_style = "SameLineWhere" -fn_args_density = "Tall" +fn_args_layout = "Tall" trailing_comma = "Vertical" indent_style = "Block" report_todo = "Always" diff --git a/tests/source/configs/fn_args_density/compressed.rs b/tests/source/configs/fn_args_layout/compressed.rs similarity index 92% rename from tests/source/configs/fn_args_density/compressed.rs rename to tests/source/configs/fn_args_layout/compressed.rs index 86c0b42e53c..66a371c259f 100644 --- a/tests/source/configs/fn_args_density/compressed.rs +++ b/tests/source/configs/fn_args_layout/compressed.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Compressed +// rustfmt-fn_args_layout: Compressed // Function arguments density trait Lorem { diff --git a/tests/source/configs/fn_args_density/tall.rs b/tests/source/configs/fn_args_layout/tall.rs similarity index 93% rename from tests/source/configs/fn_args_density/tall.rs rename to tests/source/configs/fn_args_layout/tall.rs index fc400e1c113..f11e86fd313 100644 --- a/tests/source/configs/fn_args_density/tall.rs +++ b/tests/source/configs/fn_args_layout/tall.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Tall +// rustfmt-fn_args_layout: Tall // Function arguments density trait Lorem { diff --git a/tests/source/configs/fn_args_density/vertical.rs b/tests/source/configs/fn_args_layout/vertical.rs similarity index 92% rename from tests/source/configs/fn_args_density/vertical.rs rename to tests/source/configs/fn_args_layout/vertical.rs index 20b1427d83d..a23cc025225 100644 --- a/tests/source/configs/fn_args_density/vertical.rs +++ b/tests/source/configs/fn_args_layout/vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Vertical +// rustfmt-fn_args_layout: Vertical // Function arguments density trait Lorem { diff --git a/tests/source/fn-custom-7.rs b/tests/source/fn-custom-7.rs index d76125234fa..d5330196bf7 100644 --- a/tests/source/fn-custom-7.rs +++ b/tests/source/fn-custom-7.rs @@ -1,5 +1,5 @@ // rustfmt-normalize_comments: true -// rustfmt-fn_args_density: Vertical +// rustfmt-fn_args_layout: Vertical // rustfmt-brace_style: AlwaysNextLine // Case with only one variable. diff --git a/tests/source/fn-custom.rs b/tests/source/fn-custom.rs index b8d734bfbaf..77ced4c5e0e 100644 --- a/tests/source/fn-custom.rs +++ b/tests/source/fn-custom.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Compressed +// rustfmt-fn_args_layout: Compressed // Test some of the ways function signatures can be customised. // Test compressed layout of args. diff --git a/tests/source/fn_args_density-vertical.rs b/tests/source/fn_args_layout-vertical.rs similarity index 96% rename from tests/source/fn_args_density-vertical.rs rename to tests/source/fn_args_layout-vertical.rs index b61c337dfb9..759bc83d015 100644 --- a/tests/source/fn_args_density-vertical.rs +++ b/tests/source/fn_args_layout-vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Vertical +// rustfmt-fn_args_layout: Vertical // Empty list should stay on one line. fn do_bar( diff --git a/tests/target/configs/fn_args_density/compressed.rs b/tests/target/configs/fn_args_layout/compressed.rs similarity index 93% rename from tests/target/configs/fn_args_density/compressed.rs rename to tests/target/configs/fn_args_layout/compressed.rs index 99283722bee..f189446e25d 100644 --- a/tests/target/configs/fn_args_density/compressed.rs +++ b/tests/target/configs/fn_args_layout/compressed.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Compressed +// rustfmt-fn_args_layout: Compressed // Function arguments density trait Lorem { diff --git a/tests/target/configs/fn_args_density/tall.rs b/tests/target/configs/fn_args_layout/tall.rs similarity index 94% rename from tests/target/configs/fn_args_density/tall.rs rename to tests/target/configs/fn_args_layout/tall.rs index 6ee43b41a19..20f308973ac 100644 --- a/tests/target/configs/fn_args_density/tall.rs +++ b/tests/target/configs/fn_args_layout/tall.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Tall +// rustfmt-fn_args_layout: Tall // Function arguments density trait Lorem { diff --git a/tests/target/configs/fn_args_density/vertical.rs b/tests/target/configs/fn_args_layout/vertical.rs similarity index 94% rename from tests/target/configs/fn_args_density/vertical.rs rename to tests/target/configs/fn_args_layout/vertical.rs index d48b3492452..6c695a75df9 100644 --- a/tests/target/configs/fn_args_density/vertical.rs +++ b/tests/target/configs/fn_args_layout/vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Vertical +// rustfmt-fn_args_layout: Vertical // Function arguments density trait Lorem { diff --git a/tests/target/fn-custom-7.rs b/tests/target/fn-custom-7.rs index f98150c4291..2c20ac5a752 100644 --- a/tests/target/fn-custom-7.rs +++ b/tests/target/fn-custom-7.rs @@ -1,5 +1,5 @@ // rustfmt-normalize_comments: true -// rustfmt-fn_args_density: Vertical +// rustfmt-fn_args_layout: Vertical // rustfmt-brace_style: AlwaysNextLine // Case with only one variable. diff --git a/tests/target/fn-custom.rs b/tests/target/fn-custom.rs index bf87553dedc..2eb2a973d24 100644 --- a/tests/target/fn-custom.rs +++ b/tests/target/fn-custom.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Compressed +// rustfmt-fn_args_layout: Compressed // Test some of the ways function signatures can be customised. // Test compressed layout of args. diff --git a/tests/target/fn_args_density-vertical.rs b/tests/target/fn_args_layout-vertical.rs similarity index 96% rename from tests/target/fn_args_density-vertical.rs rename to tests/target/fn_args_layout-vertical.rs index 477a48cc35f..da0ac981d87 100644 --- a/tests/target/fn_args_density-vertical.rs +++ b/tests/target/fn_args_layout-vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_args_density: Vertical +// rustfmt-fn_args_layout: Vertical // Empty list should stay on one line. fn do_bar() -> u8 { From e540eadc3c371762c77276d52d6e073541342005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Thu, 30 May 2019 10:00:58 +0200 Subject: [PATCH 6/9] update description of the fn_args_layout option to reflect the name change --- Configurations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configurations.md b/Configurations.md index 6e0d2f21b6f..304bc690034 100644 --- a/Configurations.md +++ b/Configurations.md @@ -631,7 +631,7 @@ trailing whitespaces. ## `fn_args_layout` -Argument density in functions +Control the layout of arguments in a function - **Default value**: `"Tall"` - **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"` From 7c08d3742ec3f9626efd4eec7db320131a1b8f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Thu, 30 May 2019 10:10:43 +0200 Subject: [PATCH 7/9] rename the fn_args_layout associated enum from Density to ItemsLayout --- src/config/mod.rs | 3 ++- src/config/options.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 0142b73f9e1..b9196ac920b 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -92,7 +92,8 @@ create_config! { the same line with the pattern of arms"; force_multiline_blocks: bool, false, false, "Force multiline closure bodies and match arms to be wrapped in a block"; - fn_args_layout: Density, Density::Tall, true, "Argument density in functions"; + fn_args_layout: ItemsLayout, ItemsLayout::Tall, true, + "Control the layout of arguments in a function"; brace_style: BraceStyle, BraceStyle::SameLineWhere, false, "Brace style for items"; control_brace_style: ControlBraceStyle, ControlBraceStyle::AlwaysSameLine, false, "Brace style for control flow constructs"; diff --git a/src/config/options.rs b/src/config/options.rs index 163e59ad78c..85701f7d49e 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -58,7 +58,7 @@ pub enum IndentStyle { #[config_type] /// How to place a list-like items. -pub enum Density { +pub enum ItemsLayout { /// Fit as much on one line as possible. Compressed, /// Items are placed horizontally if sufficient space, vertically otherwise. @@ -87,13 +87,13 @@ pub enum Heuristics { Default, } -impl Density { +impl ItemsLayout { pub fn to_list_tactic(self, len: usize) -> ListTactic { match self { - Density::Compressed => ListTactic::Mixed, - Density::Tall => ListTactic::HorizontalVertical, - Density::Vertical if len == 1 => ListTactic::Horizontal, - Density::Vertical => ListTactic::Vertical, + ItemsLayout::Compressed => ListTactic::Mixed, + ItemsLayout::Tall => ListTactic::HorizontalVertical, + ItemsLayout::Vertical if len == 1 => ListTactic::Horizontal, + ItemsLayout::Vertical => ListTactic::Vertical, } } } From b4650ecfbd8e1c769c2b54044b17e33dd97306ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Thu, 30 May 2019 12:14:25 +0200 Subject: [PATCH 8/9] revert renaming of the Density enum and add a FIXME comment instead --- src/config/mod.rs | 2 +- src/config/options.rs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index b9196ac920b..1b9e97fc5bf 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -92,7 +92,7 @@ create_config! { the same line with the pattern of arms"; force_multiline_blocks: bool, false, false, "Force multiline closure bodies and match arms to be wrapped in a block"; - fn_args_layout: ItemsLayout, ItemsLayout::Tall, true, + fn_args_layout: Density, Density::Tall, true, "Control the layout of arguments in a function"; brace_style: BraceStyle, BraceStyle::SameLineWhere, false, "Brace style for items"; control_brace_style: ControlBraceStyle, ControlBraceStyle::AlwaysSameLine, false, diff --git a/src/config/options.rs b/src/config/options.rs index 85701f7d49e..663c5d4dee2 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -58,7 +58,8 @@ pub enum IndentStyle { #[config_type] /// How to place a list-like items. -pub enum ItemsLayout { +/// FIXME: Issue-3581: this should be renamed to ItemsLayout when publishing 2.0 +pub enum Density { /// Fit as much on one line as possible. Compressed, /// Items are placed horizontally if sufficient space, vertically otherwise. @@ -87,13 +88,13 @@ pub enum Heuristics { Default, } -impl ItemsLayout { +impl Density { pub fn to_list_tactic(self, len: usize) -> ListTactic { match self { - ItemsLayout::Compressed => ListTactic::Mixed, - ItemsLayout::Tall => ListTactic::HorizontalVertical, - ItemsLayout::Vertical if len == 1 => ListTactic::Horizontal, - ItemsLayout::Vertical => ListTactic::Vertical, + Density::Compressed => ListTactic::Mixed, + Density::Tall => ListTactic::HorizontalVertical, + Density::Vertical if len == 1 => ListTactic::Horizontal, + Density::Vertical => ListTactic::Vertical, } } } From 892d1029815736f9b2ff26ac667f82d046e20355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Thu, 30 May 2019 16:20:10 +0200 Subject: [PATCH 9/9] fix rewrite_where_clause call added for handling trait aliases with where clauses --- src/items.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/items.rs b/src/items.rs index 75fab85f47e..ea0475ccc57 100644 --- a/src/items.rs +++ b/src/items.rs @@ -1167,7 +1167,7 @@ impl<'a> Rewrite for TraitAliasBounds<'a> { &self.generics.where_clause, context.config.brace_style(), shape, - Density::Compressed, + false, ";", None, self.generics.where_clause.span.lo(),