]> git.lizzy.rs Git - rust.git/blob - CHANGELOG.md
Associate multiple with a crate too.
[rust.git] / CHANGELOG.md
1 # Changelog
2
3 ## [Unreleased]
4
5 ## [1.4.38] 2021-10-20
6
7 ### Changed
8
9 - Switched from `rustc-ap-*` crates to `rustc_private` for consumption model of rustc internals
10 - `annotate-snippets` updated to v0.8 [PR #4762](https://github.com/rust-lang/rustfmt/pull/4762)
11 - Greatly improved the performance of `cargo fmt` in large workspaces utilizing the `--all` flag by updating to a newer version of `cargo_metadata` that leverages updated `cargo` output from v1.51+ [PR #4997](https://github.com/rust-lang/rustfmt/pull/4997)
12 - Improved formatting of long slice patterns [#4530](https://github.com/rust-lang/rustfmt/issues/4530)
13   - **Note you must have `version = Two` in your configuration to take advantage of the new formatting**
14 - Stabilized `match_block_trailing_comma` configuration option [#3380](https://github.com/rust-lang/rustfmt/issues/3380) - [https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#match_block_trailing_comma](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#match_block_trailing_comma)
15 - Stabilized `disable_all_formatting` configuration option [#5026](https://github.com/rust-lang/rustfmt/pull/5026) - [https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#disable_all_formatting](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#disable_all_formatting)
16 - Various improvements to the configuration documentation website [https://rust-lang.github.io/rustfmt/?version=v1.4.38]([https://rust-lang.github.io/rustfmt/?version=v1.4.38])
17 - Addressed various clippy and rustc warnings
18
19
20 ### Fixed
21
22 - Resolved issue where specious whitespace would be inserted when a block style comment was terminated within string literal processing [#4312](https://github.com/rust-lang/rustfmt/issues/4312)
23 - Nested out-of-line mods are again parsed and formatted [#4874](https://github.com/rust-lang/rustfmt/issues/4874)
24 - Accepts `2021` for edition value from rustfmt command line [PR #4847](https://github.com/rust-lang/rustfmt/pull/4847)
25 - Unstable command line options are no longer displayed in `--help` text on stable [PR #4798](https://github.com/rust-lang/rustfmt/issues/4798)
26 - Stopped panicking on patterns in match arms which start with non-ascii characters [#4868](https://github.com/rust-lang/rustfmt/issues/4868)
27 - Stopped stripping defaults on const params [#4816](https://github.com/rust-lang/rustfmt/issues/4816)
28 - Fixed issue with dropped content with GAT aliases with self bounds in impls [#4911](https://github.com/rust-lang/rustfmt/issues/4911)
29 - Stopped removing generic args on associated type constraints [#4943](https://github.com/rust-lang/rustfmt/issues/4943)
30 - Stopped dropping visibility on certain trait and impl items [#4960](https://github.com/rust-lang/rustfmt/issues/4960)
31 - Fixed dropping of qualified paths in struct patterns [#4908](https://github.com/rust-lang/rustfmt/issues/4908) and [#5005](https://github.com/rust-lang/rustfmt/issues/5005)
32 - Fixed bug in line width calculation that was causing specious formatting of certain patterns [#4031](https://github.com/rust-lang/rustfmt/issues/4031)
33   - **Note that this bug fix may cause observable formatting changes in cases where code had been formatted with prior versions of rustfmt that contained the bug**
34 - Fixed bug where rustfmt would drop parameter attributes if they were too long in certain cases [#4579](https://github.com/rust-lang/rustfmt/issues/4579)
35 - Resolved idempotency issue with extern body elements [#4963](https://github.com/rust-lang/rustfmt/issues/4963)
36 - rustfmt will now handle doc-style comments on function parameters, since they could appear with certain macro usage patterns even though it's generally invalid syntax [#4936](https://github.com/rust-lang/rustfmt/issues/4936)
37 - Fixed bug in `match_block_trailing_comma` where commas were not added to the blocks of bodies whose arm had a guard that did not fit on the same line as the pattern [#4998](https://github.com/rust-lang/rustfmt/pull/4998)
38 - Fixed bug in cases where derive attributes started with a block style comment [#4984](https://github.com/rust-lang/rustfmt/issues/4984)
39 - Fixed issue where the struct rest could be lost when `struct_field_align_threshold` was enabled [#4926](https://github.com/rust-lang/rustfmt/issues/4926)
40 - Handles cases where certain control flow type expressions have comments between patterns/keywords and the pattern ident contains the keyword [#5009](https://github.com/rust-lang/rustfmt/issues/5009)
41 - Handles tuple structs that have explicit visibilities and start with a block style comment [#5011](https://github.com/rust-lang/rustfmt/issues/5011)
42 - Handles leading line-style comments in certain types of macro calls [#4615](https://github.com/rust-lang/rustfmt/issues/4615)
43
44
45 ### Added
46 - Granular width heuristic options made available for user control [PR #4782](https://github.com/rust-lang/rustfmt/pull/4782). This includes the following:
47   - [`array_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#array_width)
48   - [`attr_fn_like_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#attr_fn_like_width)
49   - [`chain_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#chain_width)
50   - [`fn_call_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#fn_call_width)
51   - [`single_line_if_else_max_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#single_line_if_else_max_width)
52   - [`struct_lit_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#struct_lit_width)
53   - [`struct_variant_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#struct_variant_width)
54
55 Note this hit the rustup distributions prior to the v1.4.38 release as part of an out-of-cycle updates, but is listed in this version because the feature was not in the other v1.4.37 releases. See also the `use_small_heuristics` section on the configuration site for more information
56 [https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#use_small_heuristics](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#use_small_heuristics)
57
58 - New `One` variant added to `imports_granularity` configuration option which can be used to reformat all imports into a single use statement [#4669](https://github.com/rust-lang/rustfmt/issues/4669)
59 - rustfmt will now skip files that are annotated with `@generated` at the top of the file [#3958](https://github.com/rust-lang/rustfmt/issues/3958)
60 - New configuration option `hex_literal_case` that allows user to control the casing utilized for hex literals [PR #4903](https://github.com/rust-lang/rustfmt/pull/4903)
61
62 See the section on the configuration site for more information
63 https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#hex_literal_case
64
65 - `cargo fmt` now directly supports the `--check` flag, which means it's now possible to run `cargo fmt --check` instead of the more verbose `cargo fmt -- --check` [#3888](https://github.com/rust-lang/rustfmt/issues/3888)
66
67 ### Install/Download Options
68 - **rustup (nightly)** - *pending*
69 - **GitHub Release Binaries** - [Release v1.4.38](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.38)
70 - **Build from source** - [Tag v1.4.38](https://github.com/rust-lang/rustfmt/tree/v1.4.38), see instructions for how to [install rustfmt from source][install-from-source]
71
72 ## [1.4.37] 2021-04-03
73
74 ### Changed
75
76 - `rustc-ap-*` crates updated to v712.0.0
77
78 ### Fixed
79 - Resolve idempotence issue related to indentation of macro defs that contain or-patterns with inner comments ([#4603](https://github.com/rust-lang/rustfmt/issues/4603))
80 - Addressed various clippy and rustc warnings
81
82 ### Install/Download Options
83 - **crates.io package** - *pending*
84 - **rustup (nightly)** - *pending*
85 - **GitHub Release Binaries** - [Release v1.4.37](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.37)
86 - **Build from source** - [Tag v1.4.37](https://github.com/rust-lang/rustfmt/tree/v1.4.37), see instructions for how to [install rustfmt from source][install-from-source]
87
88 ## [1.4.36] 2021-02-07
89
90 ### Changed
91
92 - `rustc-ap-*` crates updated to v705.0.0
93
94 ### Install/Download Options
95 - **crates.io package** - *pending*
96 - **rustup (nightly)** - *pending*
97 - **GitHub Release Binaries** - [Release v1.4.36](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.36)
98 - **Build from source** - [Tag v1.4.36](https://github.com/rust-lang/rustfmt/tree/v1.4.36), see instructions for how to [install rustfmt from source][install-from-source]
99
100 ## [1.4.35] 2021-02-03
101
102 ### Changed
103
104 - `rustc-ap-*` crates updated to v702.0.0
105
106 ### Install/Download Options
107 - **crates.io package** - *pending*
108 - **rustup (nightly)** - *n/a (superseded by [v1.4.36](#1436-2021-02-07))
109 - **GitHub Release Binaries** - [Release v1.4.35](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.35)
110 - **Build from source** - [Tag v1.4.35](https://github.com/rust-lang/rustfmt/tree/v1.4.35), see instructions for how to [install rustfmt from source][install-from-source]
111
112 ## [1.4.34] 2021-01-28
113
114 ### Fixed
115 - Don't insert trailing comma on (base-less) rest in struct literals within macros ([#4675](https://github.com/rust-lang/rustfmt/issues/4675))
116
117 ### Install/Download Options
118 - **crates.io package** - *pending*
119 - **rustup (nightly)** - Starting in `2021-01-31`
120 - **GitHub Release Binaries** - [Release v1.4.34](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.34)
121 - **Build from source** - [Tag v1.4.34](https://github.com/rust-lang/rustfmt/tree/v1.4.34), see instructions for how to [install rustfmt from source][install-from-source]
122
123 ## [1.4.33] 2021-01-27
124
125 ### Changed
126 - `merge_imports` configuration has been deprecated in favor of the new `imports_granularity` option. Any existing usage of `merge_imports` will be automatically mapped to the corresponding value on `imports_granularity` with a warning message printed to encourage users to update their config files.
127
128 ### Added
129 - New `imports_granularity` option has been added which succeeds `merge_imports`. This new option supports several additional variants which allow users to merge imports at different levels (crate or module), and even flatten imports to have a single use statement per item. ([PR #4634](https://github.com/rust-lang/rustfmt/pull/4634), [PR #4639](https://github.com/rust-lang/rustfmt/pull/4639))
130
131 See the section on the configuration site for more information
132 https://rust-lang.github.io/rustfmt/?version=v1.4.33&search=#imports_granularity
133
134 ### Fixed
135 - Fix erroneous removal of `const` keyword on const trait impl ([#4084](https://github.com/rust-lang/rustfmt/issues/4084))
136 - Fix incorrect span usage wit const generics in supertraits ([#4204](https://github.com/rust-lang/rustfmt/issues/4204))
137 - Use correct span for const generic params ([#4263](https://github.com/rust-lang/rustfmt/issues/4263))
138 - Correct span on const generics to include type bounds ([#4310](https://github.com/rust-lang/rustfmt/issues/4310))
139 - Idempotence issue on blocks containing only empty statements ([#4627](https://github.com/rust-lang/rustfmt/issues/4627) and [#3868](https://github.com/rust-lang/rustfmt/issues/3868))
140 - Fix issue with semicolon placement on required functions that have a trailing comment that ends in a line-style comment before the semicolon ([#4646](https://github.com/rust-lang/rustfmt/issues/4646))
141 - Avoid shared interned cfg_if symbol since rustfmt can re-initialize the rustc_ast globals on multiple inputs ([#4656](https://github.com/rust-lang/rustfmt/issues/4656))
142
143 ### Install/Download Options
144 - **crates.io package** - *pending*
145 - **rustup (nightly)** - n/a (superseded by [v1.4.34](#1434-2021-01-28))
146 - **GitHub Release Binaries** - [Release v1.4.33](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.33)
147 - **Build from source** - [Tag v1.4.33](https://github.com/rust-lang/rustfmt/tree/v1.4.33), see instructions for how to [install rustfmt from source][install-from-source]
148
149 ## [1.4.32] 2021-01-16
150
151 ### Fixed
152 - Indentation now correct on first bound in cases where the generic bounds are multiline formatted and the first bound itself is multiline formatted ([#4636](https://github.com/rust-lang/rustfmt/issues/4636))
153
154 ### Install/Download Options
155 - **crates.io package** - *pending*
156 - **rustup (nightly)** - Starting in `2021-01-18`
157 - **GitHub Release Binaries** - [Release v1.4.32](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.32)
158 - **Build from source** - [Tag v1.4.32](https://github.com/rust-lang/rustfmt/tree/v1.4.32), see instructions for how to [install rustfmt from source][install-from-source]
159
160 ## [1.4.31] 2021-01-09
161
162 ### Changed
163
164 - `rustc-ap-*` crates updated to v697.0.0
165
166 ### Added
167 - Support for 2021 Edition [#4618](https://github.com/rust-lang/rustfmt/pull/4618))
168
169 ### Install/Download Options
170 - **crates.io package** - *pending*
171 - **rustup (nightly)** - Starting in `2021-01-16`
172 - **GitHub Release Binaries** - [Release v1.4.31](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.31)
173 - **Build from source** - [Tag v1.4.31](https://github.com/rust-lang/rustfmt/tree/v1.4.31), see instructions for how to [install rustfmt from source][install-from-source]
174
175 ## [1.4.30] 2020-12-20
176
177 ### Fixed
178 - Last character in derive no longer erroneously stripped when `indent_style` is overridden to `Visual`. ([#4584](https://github.com/rust-lang/rustfmt/issues/4584))
179 - Brace wrapping of closure bodies maintained in cases where the closure has an explicit return type and the body consists of a single expression statement. ([#4577](https://github.com/rust-lang/rustfmt/issues/4577))
180 - No more panics on invalid code with `err` and `typeof` types ([#4357](https://github.com/rust-lang/rustfmt/issues/4357), [#4586](https://github.com/rust-lang/rustfmt/issues/4586))
181
182 ### Install/Download Options
183 - **crates.io package** - *pending*
184 - **rustup (nightly)** - Starting in `2020-12-25`
185 - **GitHub Release Binaries** - [Release v1.4.30](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.30)
186 - **Build from source** - [Tag v1.4.30](https://github.com/rust-lang/rustfmt/tree/v1.4.30), see instructions for how to [install rustfmt from source][install-from-source]
187
188 ## [1.4.29] 2020-12-04
189
190 ### Fixed
191 - Negative polarity on non-trait impl now preserved. ([#4566](https://github.com/rust-lang/rustfmt/issues/4566))
192
193 ### Install/Download Options
194 - **crates.io package** - *pending*
195 - **rustup (nightly)** - Starting in `2020-12-07`
196 - **GitHub Release Binaries** - [Release v1.4.29](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.29)
197 - **Build from source** - [Tag v1.4.29](https://github.com/rust-lang/rustfmt/tree/v1.4.29), see instructions for how to [install rustfmt from source][install-from-source]
198
199 ## [1.4.28] 2020-11-29
200
201 ### Changed
202
203 - `rustc-ap-*` crates updated to v691.0.0
204 - In the event of an invalid inner attribute on a `cfg_if` condition, rustfmt will now attempt to continue and format the imported modules. Previously rustfmt would emit the parser error about an inner attribute being invalid in this position, but for rustfmt's purposes the invalid attribute doesn't prevent nor impact module formatting.
205
206 ### Added
207
208 - [`group_imports`][group-imports-config-docs] - a new configuration option that allows users to control the strategy used for grouping imports ([#4107](https://github.com/rust-lang/rustfmt/issues/4107))
209
210 [group-imports-config-docs]: https://github.com/rust-lang/rustfmt/blob/v1.4.28/Configurations.md#group_imports
211
212 ### Fixed
213 - Formatting of malformed derived attributes is no longer butchered. ([#3898](https://github.com/rust-lang/rustfmt/issues/3898), [#4029](https://github.com/rust-lang/rustfmt/issues/4029), [#4115](https://github.com/rust-lang/rustfmt/issues/4115), [#4545](https://github.com/rust-lang/rustfmt/issues/4545))
214 - Correct indentation used in macro branches when `hard_tabs` is enabled. ([#4152](https://github.com/rust-lang/rustfmt/issues/4152))
215 - Comments between the visibility modifier and item name are no longer dropped. ([#2781](https://github.com/rust-lang/rustfmt/issues/2781))
216 - Comments preceding the assignment operator in type aliases are no longer dropped. ([#4244](https://github.com/rust-lang/rustfmt/issues/4244))
217 - Comments between {`&` operator, lifetime, `mut` kw, type} are no longer dropped. ([#4245](https://github.com/rust-lang/rustfmt/issues/4245))
218 - Comments between type bounds are no longer dropped. ([#4243](https://github.com/rust-lang/rustfmt/issues/4243))
219 - Function headers are no longer dropped on foreign function items. ([#4288](https://github.com/rust-lang/rustfmt/issues/4288))
220 - Foreign function blocks are no longer dropped. ([#4313](https://github.com/rust-lang/rustfmt/issues/4313))
221 - `where_single_line` is no longer incorrectly applied to multiline function signatures that have no `where` clause. ([#4547](https://github.com/rust-lang/rustfmt/issues/4547))
222 - `matches!` expressions with multiple patterns and a destructure pattern are now able to be formatted. ([#4512](https://github.com/rust-lang/rustfmt/issues/4512))
223
224 ### Install/Download Options
225 - **crates.io package** - *pending*
226 - **rustup (nightly)** - n/a (superseded by [v1.4.29](#1429-2020-12-04))
227 - **GitHub Release Binaries** - [Release v1.4.28](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.28)
228 - **Build from source** - [Tag v1.4.28](https://github.com/rust-lang/rustfmt/tree/v1.4.28), see instructions for how to [install rustfmt from source][install-from-source]
229
230 ## [1.4.27] 2020-11-16
231
232 ### Fixed
233
234 - Leading comments in an extern block are no longer dropped (a bug that exists in v1.4.26). ([#4528](https://github.com/rust-lang/rustfmt/issues/4528))
235
236 ### Install/Download Options
237 - **crates.io package** - *pending*
238 - **rustup (nightly)** - Starting in `2020-11-18`
239 - **GitHub Release Binaries** - [Release v1.4.27](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.27)
240 - **Build from source** - [Tag v1.4.27](https://github.com/rust-lang/rustfmt/tree/v1.4.27), see instructions for how to [install rustfmt from source][install-from-source]
241
242 ## [1.4.26] 2020-11-14
243
244 ### Changed
245
246 - Original comment indentation for trailing comments within an `if` is now taken into account when determining the indentation level to use for the trailing comment in formatted code. This does not modify any existing code formatted with rustfmt; it simply gives the programmer discretion to specify whether the comment is associated to the `else` block, or if the trailing comment is just a member of the `if` block. ([#1575](https://github.com/rust-lang/rustfmt/issues/1575), [#4120](https://github.com/rust-lang/rustfmt/issues/4120), [#4506](https://github.com/rust-lang/rustfmt/issues/4506))
247
248 In this example the `// else comment` refers to the `else`:
249 ```rust
250 // if comment
251 if cond {
252     "if"
253 // else comment
254 } else {
255     "else"
256 }
257 ```
258
259 Whereas in this case the `// continue` comments are members of their respective blocks and do not refer to the `else` below.
260 ```rust
261 if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"))? {
262     if toks.eat_token(Token::Colon)? {
263         // ate the token
264     } else if toks.eat_token(Token::Word("to"))? {
265         // optionally eat the colon after to, e.g.:
266         // @rustbot modify labels to: -S-waiting-on-author, +S-waiting-on-review
267         toks.eat_token(Token::Colon)?;
268     } else {
269         // It's okay if there's no to or colon, we can just eat labels
270         // afterwards.
271     }
272     1 + 2;
273     // continue
274 } else if toks.eat_token(Token::Word("label"))? {
275     // continue
276 } else {
277     return Ok(None);
278 }
279 ```
280
281 ### Fixed
282 - Formatting of empty blocks with attributes which only contained comments is no longer butchered.([#4475](https://github.com/rust-lang/rustfmt/issues/4475), [#4467](https://github.com/rust-lang/rustfmt/issues/4467), [#4452](https://github.com/rust-lang/rustfmt/issues/4452#issuecomment-705886282), [#4522](https://github.com/rust-lang/rustfmt/issues/4522))
283 - Indentation of trailing comments in non-empty extern blocks is now correct. ([#4120](https://github.com/rust-lang/rustfmt/issues/4120#issuecomment-696491872))
284
285 ### Install/Download Options
286 - **crates.io package** - *pending*
287 - **rustup (nightly)** - Starting in `2020-11-16`
288 - **GitHub Release Binaries** - [Release v1.4.26](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.26)
289 - **Build from source** - [Tag v1.4.26](https://github.com/rust-lang/rustfmt/tree/v1.4.26), see instructions for how to [install rustfmt from source][install-from-source]
290
291 ## [1.4.25] 2020-11-10
292
293 ### Changed
294
295 - Semicolons are no longer automatically inserted on trailing expressions in macro definition arms ([#4507](https://github.com/rust-lang/rustfmt/pull/4507)). This gives the programmer control and discretion over whether there should be semicolons in these scenarios so that potential expansion issues can be avoided.
296
297 ### Install/Download Options
298 - **crates.io package** - *pending*
299 - **rustup (nightly)** - Starting in `2020-11-14`
300 - **GitHub Release Binaries** - [Release v1.4.25](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.25)
301 - **Build from source** - [Tag v1.4.25](https://github.com/rust-lang/rustfmt/tree/v1.4.25), see instructions for how to [install rustfmt from source][install-from-source]
302
303 ## [1.4.24] 2020-11-05
304
305 ### Changed
306
307 - Block wrapped match arm bodies containing a single macro call expression are no longer flattened ([#4496](https://github.com/rust-lang/rustfmt/pull/4496)). This allows programmer discretion so that the block wrapping can be preserved in cases where needed to prevent issues in expansion, such as with trailing semicolons, and aligns with updated [Style Guide guidance](https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/expressions.md#macro-call-expressions) for such scenarios.
308
309 ### Fixed
310 - Remove useless `deprecated` attribute on a trait impl block in the rustfmt lib, as these now trigger errors ([rust-lang/rust/#78626](https://github.com/rust-lang/rust/pull/78626))
311
312 ### Install/Download Options
313 - **crates.io package** - *pending*
314 - **rustup (nightly)** - Starting in `2020-11-09`
315 - **GitHub Release Binaries** - [Release v1.4.24](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.24)
316 - **Build from source** - [Tag v1.4.24](https://github.com/rust-lang/rustfmt/tree/v1.4.24), see instructions for how to [install rustfmt from source][install-from-source]
317
318 ## [1.4.23] 2020-10-30
319
320 ### Changed
321
322 - Update `rustc-ap-*` crates to v686.0.0
323
324 ### Added
325 - Initial support for formatting new ConstBlock syntax ([#4478](https://github.com/rust-lang/rustfmt/pull/4478))
326
327 ### Fixed
328 - Handling of unclosed delimiter-only parsing errors in input files ([#4466](https://github.com/rust-lang/rustfmt/issues/4466))
329 - Misc. minor parser bugs ([#4418](https://github.com/rust-lang/rustfmt/issues/4418) and [#4431](https://github.com/rust-lang/rustfmt/issues/4431))
330 - Panic on nested tuple access ([#4355](https://github.com/rust-lang/rustfmt/issues/4355))
331 - Unable to disable license template path via cli override ([#4487](https://github.com/rust-lang/rustfmt/issues/4487))
332 - Preserve comments in empty statements [#4018](https://github.com/rust-lang/rustfmt/issues/4018))
333 - Indentation on skipped code [#4398](https://github.com/rust-lang/rustfmt/issues/4398))
334
335 ### Install/Download Options
336 - **crates.io package** - *pending*
337 - **rustup (nightly)** - n/a (superseded by [v1.4.24](#1424-2020-11-05))
338 - **GitHub Release Binaries** - [Release v1.4.23](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.23)
339 - **Build from source** - [Tag v1.4.23](https://github.com/rust-lang/rustfmt/tree/v1.4.23), see instructions for how to [install rustfmt from source][install-from-source]
340
341
342
343 ## [1.4.22] 2020-10-04
344
345 ### Changed
346
347 - Update `rustc-ap-*` crates to v679.0.0
348 - Add config option to allow control of leading match arm pipes
349 - Support `RUSTFMT` environment variable in `cargo fmt` to run specified `rustfmt` instance
350
351 ### Fixed
352
353 - Fix preservation of type aliases within extern blocks
354
355
356 ## [1.4.9] 2019-10-07
357
358 ### Changed
359
360 - Update `rustc-ap-*` crates to 606.0.0.
361
362 ### Fixed
363
364 - Fix aligning comments of different group
365 - Fix flattening imports with a single `self`.
366 - Fix removing attributes on function parameters.
367 - Fix removing `impl` keyword from opaque type.
368
369 ## [1.4.8] 2019-09-08
370
371 ### Changed
372
373 - Update `rustc-ap-*` crates to 583.0.0.
374
375 ## [1.4.7] 2019-09-06
376
377 ### Added
378
379 - Add `--config` command line option.
380
381 ### Changed
382
383 - Update `rustc-ap-*` crates to 581.0.0.
384 - rustfmt now do not warn against trailing whitespaces inside macro calls.
385
386 ### Fixed
387
388 - Fix `merge_imports` generating invalid code.
389 - Fix removing discriminant values on enum variants.
390 - Fix modules defined inside `cfg_if!` not being formatted.
391 - Fix minor formatting issues.
392
393 ## [1.4.6] 2019-08-28
394
395 ### Added
396
397 - Add `--message-format` command line option to `cargo-fmt`.
398 - Add `-l,--files-with-diff` command line option to `rustfmt`.
399 - Add `json` emit mode.
400
401 ### Fixed
402
403 - Fix removing attributes on struct pattern's fields.
404 - Fix non-idempotent formatting of match arm.
405 - Fix `merge_imports` generating invalid code.
406 - Fix imports with `#![macro_use]` getting reordered with `reorder_imports`.
407 - Fix calculation of line numbers in checkstyle output.
408 - Fix poor formatting of complex fn type.
409
410 ## [1.4.5] 2019-08-13
411
412 ### Fixed
413
414 - Fix generating invalid code when formatting an impl block with const generics inside a where clause.
415 - Fix adding a trailing space after a `dyn` keyword which is used as a macro argument by itself.
416
417 ## [1.4.4] 2019-08-06
418
419 ### Fixed
420
421 - Fix `cargo fmt` incorrectly formatting crates that is not part of the workspace or the path dependencies.
422 - Fix removing a trailing comma from a tuple pattern.
423
424 ## [1.4.3] 2019-08-02
425
426 ### Changed
427
428 - Update `rustc-ap-*` crates to 546.0.0.
429
430 ### Fixed
431
432 - Fix an underscore pattern getting removed.
433
434 ## [1.4.2] 2019-07-31
435
436 ### Changed
437
438 - Explicitly require the version of `rustfmt-config_proc_macro` to be 0.1.2 or later.
439
440 ## [1.4.1] 2019-07-30
441
442 ### Changed
443
444 - Update `rustc-ap-*` crates to 542.0.0.
445
446 ## [1.4.0] 2019-07-29
447
448 ### Added
449
450 - Add new attribute `rustfmt::skip::attributes` to prevent rustfmt
451 from formatting an attribute #3665
452
453 ### Changed
454
455 - Update `rustc-ap-*` crates to 541.0.0.
456 - Remove multiple semicolons.
457
458 ## [1.3.3] 2019-07-15
459
460 ### Added
461
462 - Add `--manifest-path` support to `cargo fmt` (#3683).
463
464 ### Fixed
465
466 - Fix `cargo fmt -- --help` printing nothing (#3620).
467 - Fix inserting an extra comma (#3677).
468 - Fix incorrect handling of CRLF with `file-lines` (#3684).
469 - Fix `print-config=minimal` option (#3687).
470
471 ## [1.3.2] 2019-07-06
472
473 ### Fixed
474
475 - Fix rustfmt crashing when `await!` macro call is used in a method chain.
476 - Fix rustfmt not recognizing a package whose name differs from its directory's name.
477
478 ## [1.3.1] 2019-06-30
479
480 ### Added
481
482 - Implement the `Display` trait on the types of `Config`.
483
484 ### Changed
485
486 - `ignore` configuration option now only supports paths separated by `/`. Windows-style paths are not supported.
487 - Running `cargo fmt` in a sub-directory of a project is now supported.
488
489 ### Fixed
490
491 - Fix bugs that may cause rustfmt to crash.
492
493 ## [1.3.0] 2019-06-09
494
495 ### Added
496
497 - Format modules defined inside `cfg_if` macro calls #3600
498
499 ### Changed
500
501 - Change option `format_doc_comment` to `format_code_in_doc_comment`.
502 - `use_small_heuristics` changed to be an enum and stabilised. Configuration
503   options are now ready for 1.0.
504 - Stabilise `fn_args_density` configuration option and rename it to `fn_args_layout` #3581
505 - Update `rustc-ap-*` crates to 486.0.0
506 - Ignore sub-modules when skip-children is used #3607
507 - Removed bitrig support #3608
508
509 ### Fixed
510
511 - `wrap_comments` should not imply `format_doc_comments` #3535
512 - Incorrect handling of const generics #3555
513 - Add the handling for `vec!` with paren inside macro #3576
514 - Format trait aliases with where clauses #3586
515 - Catch panics from the parser while rewriting macro calls #3589
516 - Fix erasing inner attributes in struct #3593
517 - Inline the attribute with its item even with the `macro_use` attribute or when `reorder_imports` is disabled #3598
518 - Fix the bug add unwanted code to impl #3602
519
520 ## [1.2.2] 2019-04-24
521
522 ### Fixed
523
524 - Fix processing of `ignore` paths #3522
525 - Attempt to format attributes if only they exist #3523
526
527 ## [1.2.1] 2019-04-18
528
529 ### Added
530
531 - Add `--print-config current` CLI option b473e65
532 - Create GitHub [page](https://rust-lang.github.io/rustfmt/) for Configuration.md #3485
533
534 ### Fixed
535
536 - Keep comment appearing between parameter's name and its type #3491
537 - Do not delete semicolon after macro call with square brackets #3500
538 - Fix `--version` CLI option #3506
539 - Fix duplication of attributes on a match arm's body #3510
540 - Avoid overflowing item with attributes #3511
541
542 ## [1.2.0] 2019-03-27
543
544 ### Added
545
546 - Add new attribute `rustfmt::skip::macros` to prevent rustfmt from formatting a macro #3454
547
548 ### Changed
549
550 - Discard error report in silent_emitter #3466
551
552 ### Fixed
553
554 - Fix bad performance on deeply nested binary expressions #3467
555 - Use BTreeMap to guarantee consistent ordering b4d4b57
556
557 ## [1.1.1] 2019-03-21
558
559 ### Fixed
560
561 - Avoid panic on macro inside deeply nested block c9479de
562 - Fix line numbering in missed spans and handle file_lines in edge cases cdd08da
563 - Fix formatting of async blocks 1fa06ec
564 - Avoid duplication on the presence of spaces between macro name and `!` #3464
565
566 ## [1.1.0] 2019-03-17
567
568 ### Added
569
570 - Add `inline_attribute_width` configuration option to write an item and its attribute on the same line if their combined width is below a threshold #3409
571 - Support `const` generics f0c861b
572 - Support path clarity module #3448
573
574 ### Changed
575
576 - Align loop and while formatting 7d9a2ef
577 - Support `EmitMode::ModifiedLines` with stdin input #3424
578 - Update `rustc-ap-*` crates to 407.0.0
579 - Remove trailing whitespaces in missing spans 2d5bc69
580
581 ### Fixed
582
583 - Do not remove comment in the case of no arg 8e3ef3e
584 - Fix `Ident of macro+ident gets duplicated` error 40ff078
585 - Format the if expression at the end of the block in a single line 5f3dfe6
586
587 ## [1.0.3] 2019-02-14
588
589 ### Added
590
591 - Point unstable options to tracking issues 412dcc7
592
593 ### Changed
594
595 - Update `rustc-ap-*` crates to 373.0.0
596
597 ## [1.0.2] 2019-02-12
598
599 ### Added
600
601 - Add a [section](https://github.com/rust-lang/rustfmt/blob/ae331be/Contributing.md#version-gate-formatting-changes) to the Contributing.md file about version-gating formatting changes 36e2cb0
602 - Allow specifying package with `-p` CLI option a8d2591
603 - Support `rustfmt::skip` on imports #3289
604 - Support global `rustfmt.toml` to be written in user config directory #3280
605 - Format visibility on trait alias 96a3df3
606
607 ### Changed
608
609 - Do not modify original source code inside macro call #3260
610 - Recognize strings inside comments in order to avoid indenting them baa62c6
611 - Use Unicode-standard char width to wrap comments or strings a01990c
612 - Change new line point in the case of no args #3294
613 - Use the same formatting rule between functions and macros #3298
614 - Update rustc-ap-rustc_target to 366.0.0, rustc-ap-syntax to 366.0.0, and rustc-ap-syntax_pos to 366.0.0
615
616 ### Fixed
617
618 - rewrite_comment: fix block fallback when failing to rewrite an itemized block ab7f4e1
619 - Catch possible tokenizer panics #3240
620 - Fix macro indentation on Windows #3266
621 - Fix shape when formatting return or break expr on statement position #3259
622 - rewrite_comment: fix block fallback when failing to rewrite an itemized block
623 - Keep leading double-colon to respect the 2018 edition of rust's paths a2bfc02
624 - Fix glob and nested global imports 2125ad2
625 - Do not force trailing comma when using mixed layout #3306
626 - Prioritize `single_line_fn` and `empty_item_single_line` over `brace_style` #3308
627 - Fix `internal error: left behind trailing whitespace` with long lines c2534f5
628 - Fix attribute duplication #3325
629 - Fix formatting of strings within a macro 813aa79
630 - Handle a macro argument with a single keyword 9a7ea6a
631
632 ## [1.0.1] 2018-12-09
633
634 ### Added
635
636 - Add a `version` option 378994b
637
638 ### Changed
639
640 - End expressions like return/continue/break with a semicolon #3223
641 - Update rustc-ap-rustc_target to 306.0.0, rustc-ap-syntax to 306.0.0, and rustc-ap-syntax_pos to 306.0.0
642
643 ### Fixed
644
645 - Allow to run a rustfmt command from cargo-fmt even when there is no target a2da636
646 - Fix `un-closed delimiter` errors when formatting break labels 40174e9
647
648 ## [1.0.0] 2018-11-19
649
650 ### Changed
651
652 - Preserve possibly one whitespace for brace macros 1a3bc79
653 - Prefer to break arguments over putting output type on the next line 1dd54e6
654
655 ## [0.99.9] 2018-11-15
656
657 ### Changed
658
659 - Update rustc-ap-rustc_target to 297.0.0, rustc-ap-syntax to 297.0.0, to rustc-ap-syntax_pos to 297.0.0
660 - Don't align comments on `extern crate`s dd7add7
661
662 ## [0.99.8] 2018-11-14
663
664 ### Added
665
666 - Add `overflow_delimited_expr` config option to more aggressively allow overflow #3175
667
668 ### Fixed
669
670 - Fix the logic for retaining a comment before the arrow in a match #3181
671 - Do not wrap comments in doctest to avoid failing doctest runs #3183
672 - Fix comment rewriting that was wrapping code into a line comment #3188
673 - Fix formatting of unit-struct with `where`-clause #3200
674
675 ## [0.99.7] 2018-11-07
676
677 ### Changed
678
679 - Force a newline after the `if` condition if there is a different indentation level #3109
680 - Use correct width when formatting type on local statement #3126
681 - Treat crates non-alphabetically when ordering 799005f
682 - Fix formatting of code that is annotated with rustfmt::skip #3113
683 - Stabilize `edition` configuration option 9c3ae2d
684 - cargo-fmt: detect Rust edition in use #3129
685 - Trim the indentation on macros which heuristically appear to use block-style indentation #3178
686
687 ### Fixed
688
689 - Do not remove path disambiugator inside macro #3142
690 - Improve handling of Windows newlines #3141
691 - Fix alignment of a struct's fields (`struct_field_align_threshold` option) with the Visual `indent_style` #3165
692 - Fix a bug in formatting markdown lists within comments #3172
693
694 ## [0.99.6] 2018-10-18
695
696 ### Added
697
698 - Add `enum_discrim_align_threshold` option to vertically align enum discriminants cc22869
699 - Add `println!`-like heuristic to the `fail` attribute #3067
700 - Handle itemized items inside comments #3083
701 - Add `format_doc_comments` configuration option to control the formatting of code snippets inside comments #3089
702
703 ### Changed
704
705 - Makes brace behavior consistent with empty bodies for traits and impls 2727d41
706 - Consider a multi-lined array as a block-like expression #3969
707 - Improve formatting of strings #3073
708 - Get rid of extra commas in Visual struct literal formatting #3077
709 - Update rustc-ap-rustc_target to 274.0.0, rustc-ap-syntax to 274.0.0, and rustc-ap-syntax_pos to 274.0.0
710 - Format macro calls with item-like arguments #3080
711 - Avoid control flow expressions conditions to go multi line ef59b34
712 - Simplify multi-lining binop expressions #3101
713
714 ### Fixed
715
716 - Do not format a code block in documentation if it is annotated with ignore or text 2bcc3a9
717 - Fix inconsistent overflow behavior in Visual style #3078
718 - Fix corner cases of the string formatting implementation #3083
719 - Do not add parens around lifetimes 0ac68c9
720 - Catch parser panic in format_snippet 8c4e92a
721
722 ## [0.99.5] 2018-09-25
723
724 ### Added
725
726 - Handle leading module separator for 2018 Edition #2952
727 - Add configuration option `normalize_doc_attributes`: convert doc attributes to comments #3002
728
729 ### Changed
730
731 - Accept 2015 and 2018 instead of Edition2015 and Edition2018 for edition option eec7436
732 - Support platforms without a timer 46e2a2e
733 - Update rustc-ap-rustc_target to 263.0.0, rustc-ap-syntax to 263.0.0, and rustc-ap-syntax_pos to 263.0.0
734
735 ### Fixed
736
737 - Format of attributes with commas #2971
738 - Fix optional arg condensing #2972
739 - Improve formatting of long function parameters #2981
740 - Fix formatting of raw string literals #2983
741 - Handle chain with try operators with spaces #2986
742 - Use correct shape in Visual tuple rewriting #2987
743 - Impove formatting of arguments with `visual_style = "Visual"` option #2988
744 - Change `print_diff` to output the correct line number 992b179
745 - Propagate errors about failing to rewrite a macro 6f318e3
746 - Handle formatting of long function signature #3010
747 - Fix indent computation of a macro with braces c3edf6d
748 - Format generics on associated types #3035
749 - Incorrect indentation of multiline block match expression #3042
750 - Fix bug in import where two consecutive module separators were possible 98a0ef2
751 - Prevent right-shifting of block comments with bare lines 5fdb6db
752
753 ## [0.99.4] 2018-08-27
754
755 ### Added
756
757 - Handle formatting of underscore imports #2951
758 - Handle formatting of try blocks #2965
759
760 ### Changed
761
762 - Update rustc-ap-rustc_target to 237.0.0, rustc-ap-syntax to 237.0.0, and rustc-ap-syntax_pos to 237.0.0 ca19c9a
763 - Consider `dev` channel as nightly for unstable features #2948
764
765 ### Fixed
766
767 - Fix formatting of patterns with ellipsis # 2942
768
769 ## [0.99.3] 2018-08-23
770
771 ### Added
772
773 - Use path attribute when searching for modules #2901
774 - Expose FileLines JSON representation to allow external libraries to use the file_lines option #2915
775
776 ### Changed
777
778 - Replace '--conifig-help' with '--config=help' cb10e06
779 - Improve formatting of slice patterns #2912
780
781 ### Fixed
782
783 - Format chains with comment #2899
784 - Fix indentation of formatted macro body #2920
785 - Fix indentation of block comments f23e6aa
786
787 ## [0.99.2] 2018-08-07
788
789 ### Changed
790
791 - Update rustc-ap-rustc_target to 218.0.0, rustc-ap-syntax to 218.0.0, and rustc-ap-syntax_pos to 218.0.0 5c9a2b6
792 - Combine function-like attributes #2900
793
794 ### Fixed
795
796 - Explicitly handle semicolon after the item in statement position d96e3ca
797 - Fix parsing '#'-hiding of rustdoc 2eca09e
798
799 ## [0.99.1] 2018-08-04
800
801 ### Fixed
802
803 - fix use statements ordering when a number is present 1928ae7
804
805 ## [0.99.0] 2018-08-03
806
807 - 1.0 RC release
808
809 ### Changed
810
811 - Clarification in README.md 30fe66b
812
813 ## [0.9.0] 2018-08-01
814
815 ### Added
816
817 - Handle raw identifiers 3027c21
818 - Format async closure 60ce411
819 - Add max_width option for all heuristics c2ae39e
820 - Add config option `format_macro_matchers` to format the metavariable matching patterns in macros 79c5ee8
821 - Add config option `format_macro_bodies` to format the bodies of macros 79c5ee8
822 - Format exitential type fc307ff
823 - Support raw identifiers in struct expressions f121b1a
824 - Format Async block and async function 0b25f60
825
826 ### Changed
827
828 - Update rustc-ap-rustc_target to 211.0.0, rustc-ap-syntax to 211.0.0, and rustc-ap-syntax_pos to 211.0.0
829 - Put each nested import on its own line while putting non-nested imports on the same line as much as possible 42ab258
830 - Respect `empty_item_single_line` config option when formatting empty impls. Put the `where` on its own line to improve readability #2771
831 - Strip leading `|` in match arm patterns 1d4b988
832 - Apply short function call heuristic to attributes 3abebf9
833 - Indent a match guard if the pattern is multiline be4d37d
834 - Change default newline style to `Native` 9d8f381
835 - Improve formatting of series of binop expressions a4cdb68
836 - Trigger an internal error if we skip formatting due to a lost comment b085113
837 - Refactor chain formatting #2838
838
839 ### Fixed
840
841 - Do not insert spaces around braces with empty body or multiple lines 2f65852
842 - Allow using mixed layout with comments #2766
843 - Handle break labels #2726
844 - fix rewrite_string when a line feed is present 472a2ed
845 - Fix an anomaly with comments and array literals b28a0cd
846 - Check for comments after the `=>` in a match arm 6899471
847
848 ## [0.8.0,0.8.1,0.8.2] 2018-05-28
849
850 ### Added
851
852 - Use scoped attributes for skip attribute https://github.com/rust-lang/rustfmt/pull/2703
853
854 ### Changed
855
856 - Comment options `wrap_comments` and `normalize_comments` are reverted back to unstable 416bc4c
857 - Stabilise `reorder_imports` and `reorder_modules` options 7b6d2b4
858 - Remove `spaces_within_parens_and_brackets` option d726492
859 - Stabilise shorthand options: `use_try_shorthand`, `use_field_init_shorthand`, and `force_explicit_abi` 8afe367
860 - Stabilise `remove_nested_parens` and set default to true a70f716
861 - Unstabilise `unstable_features` dd9c15a
862 - Remove `remove_blank_lines_at_start_or_end_of_block` option 2ee8b0e
863 - Update rustc-ap-syntax to 146.0.0 and rustc-ap-rustc_target to 146.0.0 2c275a2
864 - Audit the public API #2639
865
866 ### Fixed
867
868 - Handle code block in doc comment without rust prefix f1974e2
869
870 ## [0.7.0] 2018-05-14
871
872 ### Added
873
874 - Add integration tests against crates in the rust-lang-nursery c79f39a
875
876 ### Changed
877
878 - Update rustc-ap-syntax to 128.0.0 and ustc-ap-rustc_target to 128.0.0 195395f
879 - Put operands on its own line when each fits in a single line f8439ce
880 - Improve CLI options 55ac062 1869888 798bffb 4d9de48 eca7796 8396da1 5d9f5aa
881
882 ### Fixed
883
884 - Use correct line width for list attribute 61a401a
885 - Avoid flip-flopping impl items when reordering them 37c216c
886 - Formatting breaks short lines when max_width is less than 100 9b36156
887 - Fix variant "Mixed" of imports_layout option 8c8676c
888 - Improve handling of long lines f885039
889 - Fix up lines exceeding max width 51c07f4
890 - Fix handling of modules in non_modrs_mods style cf573e8
891 - Do not duplicate attributes on use items e59ceaf
892 - Do not insert an extra brace in macros with native newlines 4c9ef93
893
894 ## [0.6.1] 2018-05-01
895
896 ### Changed
897
898 - Change the default value of imports_indent to IndentStyle::Block https://github.com/rust-lang/rustfmt/pull/2662
899
900 ### Fixed
901
902 - Handle formatting of auto traits 5b5a72c
903 - Use consistent formatting for empty enum and struct https://github.com/rust-lang/rustfmt/pull/2656
904
905 ## [0.6.0] 2018-04-20
906
907 ### Changed
908
909 - Improve public API 8669004
910
911 ## [0.5.0] 2018-04-20
912
913 ### Added
914
915 - Add `verbose-diff` CLI option 5194984
916
917 ### Changed
918
919 - Update rustc-ap-syntax to 103.0.0 dd807e2
920 - Refactor to make a sensible public API ca610d3
921
922 ### Fixed
923
924 - Add spaces between consecutive `..` `..=` 61d29eb
925
926 ## [0.4.2] 2018-04-12
927
928 ### Added
929
930 - Handle binary operators and lifetimes 0fd174d
931 - Add reorder_impl_items config option 94f5a05
932 - Add `--unstable-features` CLI option to list unstable options from the `--help` output 8208f8a
933 - Add merge_imports config option 5dd203e
934
935 ### Changed
936
937 - Format macro arguments with vertical layout ec71459
938 - Reorder imports by default 164cf7d
939 - Do not collapse block around expr with condition on match arm 5b9b7d5
940 - Use vertical layout for complex attributes c77708f
941 - Format array using heuristics for function calls 98c6f7b
942 - Implement stable ordering for impl items with the the following item priority: type, const, macro, then method fa80ddf
943 - Reorder imports by default 164cf7d
944 - Group `extern crate` by default 3a138a2
945 - Make `error_on_line_overflow` false by default f146711
946 - Merge imports with the same prefix into a single nested import 1954513
947 - Squash the various 'reorder imports' option into one 911395a
948
949 ### Fixed
950
951 - Print version is missing the channel ca6fc67
952 - Do not add the beginning vert to the match arm 1e1d9d4
953 - Follow indent style config when formatting attributes efd295a
954 - Do not insert newline when item is empty a8022f3
955 - Do not indent or unindent inside string literal ec1907b
956
957 ## [0.4.1] 2018-03-16
958
959 ### Added
960
961 - Add `ignore` configuration option.
962 - Add `license_template_path` configuration option.
963 - Format `lazy_static!`.
964
965 ### Fixed
966
967 - Fix formatting bugs.
968 - Fix setting `reorder_modules` removing inline modules.
969 - Format attributes on block expressions.
970 - Support `dyn trait` syntax.
971 - Support multiple patterns in `if let` and `while let`.
972 - Support a pattern with parentheses.
973
974 ## [0.4.0] 2018-03-02
975
976 ### Changed
977
978 - Do not print verbose outputs when formatting with stdin.
979 - Preserve trailing whitespaces in doc comments.
980 - Scale the values of width heuristics by `max_width`.
981
982 ### Fixed
983
984 - Do not reorder items with `#[macro_use]`.
985 - Fix formatting bugs.
986 - Support the beginning `|` on a match arm.
987
988 ## [0.3.8] 2018-02-04
989
990 ### Added
991
992 - Format (or at least try to format) `macro_rules!`.
993
994 ## [0.3.7] 2018-02-01
995
996 ### Added
997
998 - Add `use_field_init_shorthand` config option.
999 - Add `reorder_modules` configuration option.
1000
1001 ## [0.3.6] 2018-01-18
1002
1003 ### Fixed
1004
1005 - Fix panicking on formatting certain macros (#2371).
1006
1007 ## [0.3.5] 2018-01-15
1008
1009 ### Changed
1010
1011 - Format code block in comments when `wrap_comments` is set to `true`.
1012 - Remove `same_line_attributes` configuration option.
1013 - Rename `git-fmt` to `git-rustfmt`.
1014
1015 ### Fixed
1016
1017 - Rustup to `rustc 1.25.0-nightly (e6072a7b3 2018-01-13)`.
1018 - Fix formatting bugs.
1019
1020 ## [0.3.4] 2017-12-23
1021
1022 ### Added
1023
1024 - Add `--version` flag to `cargo-fmt`, allow `cargo fmt --version`.
1025
1026 ### Fixed
1027
1028 - Rustup to `rustc 1.24.0-nightly (5165ee9e2 2017-12-22)`.
1029
1030 ## [0.3.3] 2017-12-22
1031
1032 ### Added
1033
1034 - Format trait aliases.
1035
1036 ### Changed
1037
1038 - `cargo fmt` will format every workspace member.
1039
1040 ### Fixed
1041
1042 - Rustup to `rustc 1.24.0-nightly (250b49205 2017-12-21)`
1043 - Fix formatting bugs.
1044
1045 ## [0.3.2] 2017-12-15
1046
1047 ### Changed
1048
1049 - Warn when unknown configuration option is used.
1050
1051 ### Fixed
1052
1053 - Rustup to `rustc 1.24.0-nightly (0077d128d 2017-12-14)`.
1054
1055 ## [0.3.1] 2017-12-11
1056
1057 ### Added
1058
1059 - Add `error_on_unformatted` configuration option.
1060 - Add `--error-on-unformatted` command line option.
1061
1062 ### Changed
1063
1064 - Do not report formatting errors on comments or strings by default.
1065 - Rename `error_on_line_overflow_comments` to `error_on_unformatted`.
1066
1067 ### Fixed
1068
1069 - Fix formatting bugs.
1070 - Fix adding a trailing whitespace inside code block when `wrap_comments = true`.
1071
1072 ## [0.3.0] 2017-12-11
1073
1074 ### Added
1075
1076 - Support nested imports.
1077
1078 ### Changed
1079
1080 - Do not report errors on skipped items.
1081 - Do not format code block inside comments when `wrap_comments = true`.
1082 - Keep vertical spaces between items within range.
1083 - Format `format!` and its variants using compressed style.
1084 - Format `write!` and its variants using compressed style.
1085 - Format **simple** array using compressed style.
1086
1087 ### Fixed
1088
1089 - Fix `rustfmt --package package_name` not working properly.
1090 - Fix formatting bugs.
1091
1092 ## [0.2.17] 2017-12-03
1093
1094 ### Added
1095
1096 - Add `blank_lines_lower_bound` and `blank_lines_upper_bound` configuration options.
1097
1098 ### Changed
1099
1100 - Combine configuration options related to width heuristic into `width_heuristic`.
1101 - If the match arm's body is `if` expression, force to use block.
1102
1103 ### Fixed
1104
1105 - Fix `cargo fmt --all` being trapped in an infinite loop.
1106 - Fix many formatting bugs.
1107
1108 ### Removed
1109
1110 - Remove legacy configuration options.
1111
1112 ## [0.2.16] 2017-11-21
1113
1114 ### Added
1115
1116 - Remove empty lines at the beginning of the file.
1117 - Soft wrapping on doc comments.
1118
1119 ### Changed
1120
1121 - Break before `|` when using multiple lines for match arm patterns.
1122 - Combine `control_style`, `where_style` and `*_indent` config options into `indent_style`.
1123 - Combine `item_brace_style` and `fn_brace_style` config options into `brace_style`.
1124 - Combine config options related spacing around colons into `space_before_colon` and `space_after_colon`.
1125
1126 ### Fixed
1127
1128 - Fix many bugs.
1129
1130 ## [0.2.15] 2017-11-08
1131
1132 ### Added
1133
1134 - Add git-fmt tool
1135 - `where_single_line` configuration option.
1136
1137 ### Changed
1138
1139 - Rename `chain_one_line_max` to `chain_width`.
1140 - Change the suffix of indent-related configuration options to `_indent`.
1141
1142 ## [0.2.14] 2017-11-06
1143
1144 ### Fixed
1145
1146 - Rustup to the latest nightly.
1147
1148 ## [0.2.13] 2017-10-30
1149
1150 ### Fixed
1151
1152 - Rustup to the latest nightly.
1153
1154 ## [0.2.12] 2017-10-29
1155
1156 ### Fixed
1157
1158 - Fix a bug that `cargo fmt` hangs forever.
1159
1160 ## [0.2.11] 2017-10-29
1161
1162 ### Fixed
1163
1164 - Fix a bug that `cargo fmt` crashes.
1165
1166 ## [0.2.10] 2017-10-28
1167
1168 ## [0.2.9] 2017-10-16
1169
1170 ## [0.2.8] 2017-09-28
1171
1172 ## [0.2.7] 2017-09-21
1173
1174 ### Added
1175
1176 - `binop_separator` configuration option (#1964).
1177
1178 ### Changed
1179
1180 - Use horizontal layout for function call with a single argument.
1181
1182 ### Fixed
1183
1184 - Fix panicking when calling `cargo fmt --all` (#1963).
1185 - Refactorings & faster rustfmt.
1186
1187 ## [0.2.6] 2017-09-14
1188
1189 ### Fixed
1190
1191 - Fix a performance issue with nested block (#1940).
1192 - Refactorings & faster rustfmt.
1193
1194 ## [0.2.5] 2017-08-31
1195
1196 ### Added
1197
1198 - Format and preserve attributes on statements (#1933).
1199
1200 ### Fixed
1201
1202 - Use getters to access `Span` fields (#1899).
1203
1204 ## [0.2.4] 2017-08-30
1205
1206 ### Added
1207
1208 - Add support for `Yield` (#1928).
1209
1210 ## [0.2.3] 2017-08-30
1211
1212 ### Added
1213
1214 - `multiline_closure_forces_block` configuration option (#1898).
1215 - `multiline_match_arm_forces_block` configuration option (#1898).
1216 - `merge_derives` configuration option (#1910).
1217 - `struct_remove_empty_braces` configuration option (#1930).
1218 - Various refactorings.
1219
1220 ### Changed
1221
1222 - Put single-lined block comments on the same line with list-like structure's item (#1923).
1223 - Preserve blank line between doc comment and attribute (#1925).
1224 - Put the opening and the closing braces of enum and struct on the same line, even when `item_brace_style = "AlwaysNextLine"` (#1930).
1225
1226 ### Fixed
1227
1228 - Format attributes on `ast::ForeignItem` and take max width into account (#1916).
1229 - Ignore empty lines when calculating the shortest indent width inside macro with braces (#1918).
1230 - Handle tabs properly inside macro with braces (#1918).
1231 - Fix a typo in `compute_budgets_for_args()` (#1924).
1232 - Recover comment between keyword (`impl` and `trait`) and `{` which used to get removed (#1925).
1233
1234
1235 [install-from-source]: https://github.com/rust-lang/rustfmt#installing-from-source