]> git.lizzy.rs Git - rust.git/blob - CHANGELOG.md
changelog for 0.99.9
[rust.git] / CHANGELOG.md
1 # Changelog
2
3 ## [Unreleased]
4
5 - Change option `format_doc_comment` to `format_code_in_doc_comment`.
6 - `use_small_heuristics` changed to be an enum and stabilised. Configuration
7   options are now ready for 1.0.
8
9 ## [0.99.9] 2018-11-15
10
11 ### Changed
12
13 - 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
14 - Don't align comments on `extern crate`s dd7add7
15
16 ## [0.99.8] 2018-11-14
17
18 ### Added
19
20 - Add `overflow_delimited_expr` config option to more aggressively allow overflow #3175
21
22 ### Fixed
23
24 - Fix the logic for retaining a comment before the arrow in a match #3181
25 - Do not wrap comments in doctest to avoid failing doctest runs #3183
26 - Fix comment rewriting that was wrapping code into a line comment #3188
27 - Fix formatting of unit-struct with `where`-clause #3200
28
29 ## [0.99.7] 2018-11-07
30
31 ### Changed
32
33 - Force a newline after the `if` condition if there is a different indentation level #3109
34 - Use correct width when formatting type on local statement #3126
35 - Treat crates non-alphabetically when ordering 799005f
36 - Fix formatting of code that is annotated with rustfmt::skip #3113
37 - Stabilize `edition` configuration option 9c3ae2d
38 - cargo-fmt: detect Rust edition in use #3129
39 - Trim the indentation on macros which heuristically appear to use block-style indentation #3178
40
41 ### Fixed
42
43 - Do not remove path disambiugator inside macro #3142
44 - Improve handling of Windows newlines #3141
45 - Fix alignment of a struct's fields (`struct_field_align_threshold` option) with the Visual `indent_style` #3165
46 - Fix a bug in formatting markdown lists within comments #3172
47
48 ## [0.99.6] 2018-10-18
49
50 ### Added
51
52 - Add `enum_discrim_align_threshold` option to vertically align enum discriminants cc22869
53 - Add `println!`-like heuristic to the `fail` attribute #3067
54 - Handle itemized items inside comments #3083
55 - Add `format_doc_comments` configuration option to control the formatting of code snippets inside comments #3089
56
57 ### Changed
58
59 - Makes brace behavior consistent with empty bodies for traits and impls 2727d41
60 - Consider a multi-lined array as a block-like expression #3969
61 - Improve formatting of strings #3073
62 - Get rid of extra commas in Visual struct literal formatting #3077
63 - 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
64 - Format macro calls with item-like arguments #3080
65 - Avoid control flow expressions conditions to go multi line ef59b34
66 - Simplify multi-lining binop expressions #3101
67
68 ### Fixed
69
70 - Do not format a code block in documentation if it is annotated with ignore or text 2bcc3a9
71 - Fix inconsistent overflow behavior in Visual style #3078
72 - Fix corner cases of the string formatting implementation #3083
73 - Do not add parens around lifetimes 0ac68c9
74 - Catch parser panic in format_snippet 8c4e92a
75
76 ## [0.99.5] 2018-09-25
77
78 ### Added
79
80 - Handle leading module separator for 2018 Edition #2952
81 - Add configuration option `normalize_doc_attributes`: convert doc attributes to comments #3002
82
83 ### Changed
84
85 - Accept 2015 and 2018 instead of Edition2015 and Edition2018 for edition option eec7436
86 - Support platforms without a timer 46e2a2e
87 - 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
88
89 ### Fixed
90
91 - Format of attributes with commas #2971
92 - Fix optional arg condensing #2972
93 - Improve formatting of long function parameters #2981
94 - Fix formatting of raw string literals #2983
95 - Handle chain with try operators with spaces #2986
96 - Use correct shape in Visual tuple rewriting #2987
97 - Impove formatting of arguments with `visual_style = "Visual"` option #2988
98 - Change `print_diff` to output the correct line number 992b179
99 - Propagate errors about failing to rewrite a macro 6f318e3
100 - Handle formatting of long function signature #3010
101 - Fix indent computation of a macro with braces c3edf6d
102 - Format generics on associated types #3035
103 - Incorrect indentation of multiline block match expression #3042
104 - Fix bug in import where two consecutive module separators were possible 98a0ef2
105 - Prevent right-shifting of block comments with bare lines 5fdb6db
106
107 ## [0.99.4] 2018-08-27
108
109 ### Added
110
111 - Handle formatting of underscore imports #2951
112 - Handle formatting of try blocks #2965
113
114 ### Changed
115
116 - 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
117 - Consider `dev` channel as nightly for unstable features #2948
118
119 ### Fixed
120
121 - Fix formatting of patterns with ellipsis # 2942
122
123 ## [0.99.3] 2018-08-23
124
125 ### Added
126
127 - Use path attribute when searching for modules #2901
128 - Expose FileLines JSON representation to allow external libraries to use the file_lines option #2915
129
130 ### Changed
131
132 - Replace '--conifig-help' with '--config=help' cb10e06
133 - Improve formatting of slice patterns #2912
134
135 ### Fixed
136
137 - Format chains with comment #2899
138 - Fix indentation of formatted macro body #2920
139 - Fix indentation of block comments f23e6aa
140
141 ## [0.99.2] 2018-08-07
142
143 ### Changed
144
145 - 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
146 - Combine function-like attributes #2900
147
148 ### Fixed
149
150 - Explicitly handle semicolon after the item in statement position d96e3ca
151 - Fix parsing '#'-hiding of rustdoc 2eca09e
152
153 ## [0.99.1] 2018-08-04
154
155 ### Fixed
156
157 - fix use statements ordering when a number is present 1928ae7
158
159 ## [0.99.0] 2018-08-03
160
161 - 1.0 RC release
162
163 ### Changed
164
165 - Clarification in README.md 30fe66b
166
167 ## [0.9.0] 2018-08-01
168
169 ### Added
170
171 - Handle raw identifiers 3027c21
172 - Format async closure 60ce411
173 - Add max_width option for all heuristics c2ae39e
174 - Add config option `format_macro_matchers` to format the metavariable matching patterns in macros 79c5ee8
175 - Add config option `format_macro_bodies` to format the bodies of macros 79c5ee8
176 - Format exitential type fc307ff
177 - Support raw identifiers in struct expressions f121b1a
178 - Format Async block and async function 0b25f60
179
180 ### Changed
181
182 - 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
183 - Put each nested import on its own line while putting non-nested imports on the same line as much as possible 42ab258
184 - Respect `empty_item_single_line` config option when formatting empty impls. Put the `where` on its own line to improve readability #2771
185 - Strip leading `|` in match arm patterns 1d4b988
186 - Apply short function call heuristic to attributes 3abebf9
187 - Indent a match guard if the pattern is multiline be4d37d
188 - Change default newline style to `Native` 9d8f381
189 - Improve formatting of series of binop expressions a4cdb68
190 - Trigger an internal error if we skip formatting due to a lost comment b085113
191 - Refactor chain formatting #2838
192
193 ### Fixed
194
195 - Do not insert spaces around braces with empty body or multiple lines 2f65852
196 - Allow using mixed layout with comments #2766
197 - Handle break labels #2726
198 - fix rewrite_string when a line feed is present 472a2ed
199 - Fix an anomaly with comments and array literals b28a0cd
200 - Check for comments after the `=>` in a match arm 6899471
201
202 ## [0.8.0,0.8.1,0.8.2] 2018-05-28
203
204 ### Added
205
206 - Use scoped attributes for skip attribute https://github.com/rust-lang/rustfmt/pull/2703
207
208 ### Changed
209
210 - Comment options `wrap_comments` and `normalize_comments` are reverted back to unstable 416bc4c
211 - Stabilise `reorder_imports` and `reorder_modules` options 7b6d2b4
212 - Remove `spaces_within_parens_and_brackets` option d726492
213 - Stabilise shorthand options: `use_try_shorthand`, `use_field_init_shorthand`, and `force_explicit_abi` 8afe367
214 - Stabilise `remove_nested_parens` and set default to true a70f716
215 - Unstabilise `unstable_features` dd9c15a
216 - Remove `remove_blank_lines_at_start_or_end_of_block` option 2ee8b0e
217 - Update rustc-ap-syntax to 146.0.0 and rustc-ap-rustc_target to 146.0.0 2c275a2
218 - Audit the public API #2639
219
220 ### Fixed
221
222 - Handle code block in doc comment without rust prefix f1974e2
223
224 ## [0.7.0] 2018-05-14
225
226 ### Added
227
228 - Add integration tests against crates in the rust-lang-nursery c79f39a
229
230 ### Changed
231
232 - Update rustc-ap-syntax to 128.0.0 and ustc-ap-rustc_target to 128.0.0 195395f
233 - Put operands on its own line when each fits in a single line f8439ce
234 - Improve CLI options 55ac062 1869888 798bffb 4d9de48 eca7796 8396da1 5d9f5aa
235
236 ### Fixed
237
238 - Use correct line width for list attribute 61a401a
239 - Avoid flip-flopping impl items when reordering them 37c216c
240 - Formatting breaks short lines when max_width is less than 100 9b36156
241 - Fix variant "Mixed" of imports_layout option 8c8676c
242 - Improve handling of long lines f885039
243 - Fix up lines exceeding max width 51c07f4
244 - Fix handling of modules in non_modrs_mods style cf573e8
245 - Do not duplicate attributes on use items e59ceaf
246 - Do not insert an extra brace in macros with native newlines 4c9ef93
247
248 ## [0.6.1] 2018-05-01
249
250 ### Changed
251
252 - Change the default value of imports_indent to IndentStyle::Block https://github.com/rust-lang/rustfmt/pull/2662
253
254 ### Fixed
255
256 - Handle formatting of auto traits 5b5a72c
257 - Use consistent formatting for empty enum and struct https://github.com/rust-lang/rustfmt/pull/2656
258
259 ## [0.6.0] 2018-04-20
260
261 ### Changed
262
263 - Improve public API 8669004
264
265 ## [0.5.0] 2018-04-20
266
267 ### Added
268
269 - Add `verbose-diff` CLI option 5194984
270
271 ### Changed
272
273 - Update rustc-ap-syntax to 103.0.0 dd807e2
274 - Refactor to make a sensible public API ca610d3
275
276 ### Fixed
277
278 - Add spaces between consecutive `..` `..=` 61d29eb
279
280 ## [0.4.2] 2018-04-12
281
282 ### Added
283
284 - Handle binary operators and lifetimes 0fd174d
285 - Add reorder_impl_items config option 94f5a05
286 - Add `--unstable-features` CLI option to list unstable options from the `--help` output 8208f8a
287 - Add merge_imports config option 5dd203e
288
289 ### Changed
290
291 - Format macro arguments with vertical layout ec71459
292 - Reorder imports by default 164cf7d
293 - Do not collapse block around expr with condition on match arm 5b9b7d5
294 - Use vertical layout for complex attributes c77708f
295 - Format array using heuristics for function calls 98c6f7b
296 - Implement stable ordering for impl items with the the following item priority: type, const, macro, then method fa80ddf
297 - Reorder imports by default 164cf7d
298 - Group `extern crate` by default 3a138a2
299 - Make `error_on_line_overflow` false by default f146711
300 - Merge imports with the same prefix into a single nested import 1954513
301 - Squash the various 'reorder imports' option into one 911395a
302
303 ### Fixed
304
305 - Print version is missing the channel ca6fc67
306 - Do not add the beginning vert to the match arm 1e1d9d4
307 - Follow indent style config when formatting attributes efd295a
308 - Do not insert newline when item is empty a8022f3
309 - Do not indent or unindent inside string literal ec1907b
310
311 ## [0.4.1] 2018-03-16
312
313 ### Added
314
315 - Add `ignore` configuration option.
316 - Add `license_template_path` configuration option.
317 - Format `lazy_static!`.
318
319 ### Fixed
320
321 - Fix formatting bugs.
322 - Fix setting `reorder_modules` removing inline modules.
323 - Format attributes on block expressions.
324 - Support `dyn trait` syntax.
325 - Support multiple patterns in `if let` and `while let`.
326 - Support a pattern with parentheses.
327
328 ## [0.4.0] 2018-03-02
329
330 ### Changed
331
332 - Do not print verbose outputs when formatting with stdin.
333 - Preserve trailing whitespaces in doc comments.
334 - Scale the values of width heuristics by `max_width`.
335
336 ### Fixed
337
338 - Do not reorder items with `#[macro_use]`.
339 - Fix formatting bugs.
340 - Support the beginning `|` on a match arm.
341
342 ## [0.3.8] 2018-02-04
343
344 ### Added
345
346 - Format (or at least try to format) `macro_rules!`.
347
348 ## [0.3.7] 2018-02-01
349
350 ### Added
351
352 - Add `use_field_init_shorthand` config option.
353 - Add `reorder_modules` configuration option.
354
355 ## [0.3.6] 2018-01-18
356
357 ### Fixed
358
359 - Fix panicking on formatting certain macros (#2371).
360
361 ## [0.3.5] 2018-01-15
362
363 ### Changed
364
365 - Format code block in comments when `wrap_comments` is set to `true`.
366 - Remove `same_line_attributes` configuration option.
367 - Rename `git-fmt` to `git-rustfmt`.
368
369 ### Fixed
370
371 - Rustup to `rustc 1.25.0-nightly (e6072a7b3 2018-01-13)`.
372 - Fix formatting bugs.
373
374 ## [0.3.4] 2017-12-23
375
376 ### Added
377
378 - Add `--version` flag to `cargo-fmt`, allow `cargo fmt --version`.
379
380 ### Fixed
381
382 - Rustup to `rustc 1.24.0-nightly (5165ee9e2 2017-12-22)`.
383
384 ## [0.3.3] 2017-12-22
385
386 ### Added
387
388 - Format trait aliases.
389
390 ### Changed
391
392 - `cargo fmt` will format every workspace member.
393
394 ### Fixed
395
396 - Rustup to `rustc 1.24.0-nightly (250b49205 2017-12-21)`
397 - Fix formatting bugs.
398
399 ## [0.3.2] 2017-12-15
400
401 ### Changed
402
403 - Warn when unknown configuration option is used.
404
405 ### Fixed
406
407 - Rustup to `rustc 1.24.0-nightly (0077d128d 2017-12-14)`.
408
409 ## [0.3.1] 2017-12-11
410
411 ### Added
412
413 - Add `error_on_unformatted` configuration option.
414 - Add `--error-on-unformatted` command line option.
415
416 ### Changed
417
418 - Do not report formatting errors on comments or strings by default.
419 - Rename `error_on_line_overflow_comments` to `error_on_unformatted`.
420
421 ### Fixed
422
423 - Fix formatting bugs.
424 - Fix adding a trailing whitespace inside code block when `wrap_comments = true`.
425
426 ## [0.3.0] 2017-12-11
427
428 ### Added
429
430 - Support nested imports.
431
432 ### Changed
433
434 - Do not report errors on skipped items.
435 - Do not format code block inside comments when `wrap_comments = true`.
436 - Keep vertical spaces between items within range.
437 - Format `format!` and its variants using compressed style.
438 - Format `write!` and its variants using compressed style.
439 - Format **simple** array using compressed style.
440
441 ### Fixed
442
443 - Fix `rustfmt --package package_name` not working properly.
444 - Fix formatting bugs.
445
446 ## [0.2.17] 2017-12-03
447
448 ### Added
449
450 - Add `blank_lines_lower_bound` and `blank_lines_upper_bound` configuration options.
451
452 ### Changed
453
454 - Combine configuration options related to width heuristic into `width_heuristic`.
455 - If the match arm's body is `if` expression, force to use block.
456
457 ### Fixed
458
459 - Fix `cargo fmt --all` being trapped in an infinite loop.
460 - Fix many formatting bugs.
461
462 ### Removed
463
464 - Remove legacy configuration options.
465
466 ## [0.2.16] 2017-11-21
467
468 ### Added
469
470 - Remove empty lines at the beginning of the file.
471 - Soft wrapping on doc comments.
472
473 ### Changed
474
475 - Break before `|` when using multiple lines for match arm patterns.
476 - Combine `control_style`, `where_style` and `*_indent` config options into `indent_style`.
477 - Combine `item_brace_style` and `fn_brace_style` config options into `brace_style`.
478 - Combine config options related spacing around colons into `space_before_colon` and `space_after_colon`.
479
480 ### Fixed
481
482 - Fix many bugs.
483
484 ## [0.2.15] 2017-11-08
485
486 ### Added
487
488 - Add git-fmt tool
489 - `where_single_line` configuration option.
490
491 ### Changed
492
493 - Rename `chain_one_line_max` to `chain_width`.
494 - Change the suffix of indent-related configuration options to `_indent`.
495
496 ## [0.2.14] 2017-11-06
497
498 ### Fixed
499
500 - Rustup to the latest nightly.
501
502 ## [0.2.13] 2017-10-30
503
504 ### Fixed
505
506 - Rustup to the latest nightly.
507
508 ## [0.2.12] 2017-10-29
509
510 ### Fixed
511
512 - Fix a bug that `cargo fmt` hangs forever.
513
514 ## [0.2.11] 2017-10-29
515
516 ### Fixed
517
518 - Fix a bug that `cargo fmt` crashes.
519
520 ## [0.2.10] 2017-10-28
521
522 ## [0.2.9] 2017-10-16
523
524 ## [0.2.8] 2017-09-28
525
526 ## [0.2.7] 2017-09-21
527
528 ### Added
529
530 - `binop_separator` configuration option (#1964).
531
532 ### Changed
533
534 - Use horizontal layout for function call with a single argument.
535
536 ### Fixed
537
538 - Fix panicking when calling `cargo fmt --all` (#1963).
539 - Refactorings & faster rustfmt.
540
541 ## [0.2.6] 2017-09-14
542
543 ### Fixed
544
545 - Fix a performance issue with nested block (#1940).
546 - Refactorings & faster rustfmt.
547
548 ## [0.2.5] 2017-08-31
549
550 ### Added
551
552 - Format and preserve attributes on statements (#1933).
553
554 ### Fixed
555
556 - Use getters to access `Span` fields (#1899).
557
558 ## [0.2.4] 2017-08-30
559
560 ### Added
561
562 - Add support for `Yield` (#1928).
563
564 ## [0.2.3] 2017-08-30
565
566 ### Added
567
568 - `multiline_closure_forces_block` configuration option (#1898).
569 - `multiline_match_arm_forces_block` configuration option (#1898).
570 - `merge_derives` configuration option (#1910).
571 - `struct_remove_empty_braces` configuration option (#1930).
572 - Various refactorings.
573
574 ### Changed
575
576 - Put single-lined block comments on the same line with list-like structure's item (#1923).
577 - Preserve blank line between doc comment and attribute (#1925).
578 - Put the opening and the closing braces of enum and struct on the same line, even when `item_brace_style = "AlwaysNextLine"` (#1930).
579
580 ### Fixed
581
582 - Format attributes on `ast::ForeignItem` and take max width into account (#1916).
583 - Ignore empty lines when calculating the shortest indent width inside macro with braces (#1918).
584 - Handle tabs properly inside macro with braces (#1918).
585 - Fix a typo in `compute_budgets_for_args()` (#1924).
586 - Recover comment between keyword (`impl` and `trait`) and `{` which used to get removed (#1925).