Skip to content

Commit b6a8d58

Browse files
Merge branch 'master' into master
2 parents 174b7a0 + 7289391 commit b6a8d58

File tree

169 files changed

+3626
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+3626
-1043
lines changed

.github/workflows/check_diff.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
rustup target add x86_64-unknown-linux-gnu
3131
3232
- name: check diff
33-
run: bash ${GITHUB_WORKSPACE}/ci/check_diff.sh ${{ github.event.inputs.clone_url }} ${{ github.event.inputs.branch_name }} ${{ github.event.inputs.commit_hash }} ${{ github.event.inputs.rustfmt_configs }}
33+
run: bash ${GITHUB_WORKSPACE}/ci/check_diff.sh ${{ github.event.inputs.clone_url }} ${{ github.event.inputs.branch_name }} ${{ github.event.inputs.commit_hash || github.event.inputs.branch_name }} ${{ github.event.inputs.rustfmt_configs }}

CHANGELOG.md

+85-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,83 @@
22

33
## [Unreleased]
44

5+
- Updating `dirs 4.0.0 -> 5.0.1` and `cargo_metadata 0.15.4 -> 0.18.0` [#6033] (https://github.com/rust-lang/rustfmt/issues/6033)
6+
7+
## [1.7.0] 2023-10-22
8+
9+
### Fixed
10+
11+
- Sometimes when `format_code_in_doc_comments=true` was set some line comments were converted to block comments [#5533](https://github.com/rust-lang/rustfmt/issues/5533)
12+
- rustfmt will no longer remove the braces in match arms when the block has a labeled [#5676](https://github.com/rust-lang/rustfmt/issues/5676)
13+
```rust
14+
fn main() {
15+
match true {
16+
true => 'a: {
17+
break 'a
18+
}
19+
_ => (),
20+
}
21+
}
22+
```
23+
- Calling methods on float literals ending in `.` will now be wrapped in parenthesis. e.g. `0. .to_string()` will be formatted as `(0.).to_string()` [#5791](https://github.com/rust-lang/rustfmt/issues/5791)
24+
- Prevent ICE when formatting empty `macro_rules!` branch [#5730](https://github.com/rust-lang/rustfmt/issues/5730)
25+
```rust
26+
macro_rules! statement {
27+
() => {;};
28+
}
29+
```
30+
- Prevent ICE when formatting `vec!{}` [#5735](https://github.com/rust-lang/rustfmt/issues/5735)
31+
- Prevent internal trailing whitespace error when formatting an empty `macro_rules!` definition e.g. `macro_rules! foo {}` [#5882](https://github.com/rust-lang/rustfmt/issues/5882)
32+
- Formatting doc comment lines that start with `.` or `)` won't be treated as ordered markdown lists because `.` or `)` must be preceded by a number to start an ordered markdown list [#5835](https://github.com/rust-lang/rustfmt/pull/5835)
33+
- Add parenthesis around closures when they're used as method receives, don't have a block body, and end with `.` [#4808](https://github.com/rust-lang/rustfmt/issues/4808)
34+
```rust
35+
fn main() {
36+
|| (10.).method();
37+
(|| ..).method();
38+
(|| 1..).method();
39+
}
40+
```
41+
- Prevent removing `for<T>` when using the [`#![feature(non_lifetime_binders)]`](https://github.com/rust-lang/rust/issues/108185) [#5721](https://github.com/rust-lang/rustfmt/issues/5721)
42+
```rust
43+
#![feature(non_lifetime_binders)]
44+
#![allow(incomplete_features)]
45+
46+
trait Other<U: ?Sized> {}
47+
48+
trait Trait<U>
49+
where
50+
for<T> U: Other<T> {}
51+
```
52+
- Fix various issues with comments in imports [#5852](https://github.com/rust-lang/rustfmt/issues/5852) [#4708](https://github.com/rust-lang/rustfmt/issues/4708) [#3984](https://github.com/rust-lang/rustfmt/issues/3984)
53+
- When setting `version = Two` newlines between where clause bounds will be removed [#5655](https://github.com/rust-lang/rustfmt/issues/5655)
54+
```rust
55+
fn foo<T>(_: T)
56+
where
57+
T: std::fmt::Debug,
58+
T: std::fmt::Display,
59+
{
60+
}
61+
```
62+
- Improve formatting of `let-else` statements that have leading attributes When setting `version = Two` [#5901](https://github.com/rust-lang/rustfmt/issues/5901)
63+
- Prevent comment duplication in expressions wrapped in parenthesis. [#5871](https://github.com/rust-lang/rustfmt/issues/5871)
64+
- Adjust the span derivation used when rewriting const generics. The incorrect span derivation lead to invalid code after reformatting. [#5935](https://github.com/rust-lang/rustfmt/issues/5935)
65+
66+
67+
### Changed
68+
69+
- rustfmt no longer removes explicit `Rust` ABIs. e.g `extern "Rust" fn im_a_rust_fn() {}` [#5701](https://github.com/rust-lang/rustfmt/issues/5701)
70+
- Setting `trailing_semicolon = false` will only remove trailing `;` on the last expression in a block [#5797](https://github.com/rust-lang/rustfmt/issues/5797)
71+
- Update the format of `cargo help fmt` to be more consistent with other standard commands [#5908](https://github.com/rust-lang/rustfmt/pull/5908)
72+
73+
### Added
74+
75+
- Users can now set `skip_macro_invocations` in `rustfmt.toml` [#5816](https://github.com/rust-lang/rustfmt/issues/5816)
76+
- Adds initial support for formatting `let-chains`. **`let-chains` are still a nightly feature and their formatting is subject to change** [#5910](https://github.com/rust-lang/rustfmt/pull/5910). Formatting was implemented following the rules outlined in [rust-lang/rust#110568](https://github.com/rust-lang/rust/pull/110568)
77+
78+
### Misc
79+
80+
- Support the experimental `dyn*` syntax, enabled by `#![feature(dyn_star)]` [#5542](https://github.com/rust-lang/rustfmt/issues/5542)
81+
- Replace `unicode_categories` dependency with `unicode-properties` [#5864](https://github.com/rust-lang/rustfmt/pull/5864)
582

683
## [1.6.0] 2023-07-02
784

@@ -10,7 +87,7 @@
1087
- Support for formatting let-else statements [#5690]
1188
- New config option, `single_line_let_else_max_width`, that allows users to configure the maximum length of single line `let-else` statements. `let-else` statements that otherwise meet the requirements to be formatted on a single line will have their divergent`else` block formatted over multiple lines if they exceed this length [#5684]
1289

13-
[#5690]: https://github.com/rust-lang/rustfmt/pulls/5690
90+
[#5690]: https://github.com/rust-lang/rustfmt/pull/5690
1491
[#5684]: https://github.com/rust-lang/rustfmt/issues/5684
1592

1693
## [1.5.3] 2023-06-20
@@ -19,7 +96,7 @@
1996

2097
- When formatting doc comments with `wrap_comments = true` rustfmt will no longer wrap markdown tables [#4210](https://github.com/rust-lang/rustfmt/issues/4210)
2198
- Properly handle wrapping comments that include a numbered list in markdown [#5416](https://github.com/rust-lang/rustfmt/issues/5416)
22-
- Properly handle markdown sublists that utilize a `+` [#4041](https://github.com/rust-lang/rustfmt/issues/4210)
99+
- Properly handle markdown sublists that utilize a `+` [#4041](https://github.com/rust-lang/rustfmt/issues/4041)
23100
- rustfmt will no longer use shorthand initialization when rewriting a tuple struct even when `use_field_init_shorthand = true` as this leads to code that could no longer compile.
24101
Take the following struct as an example `struct MyStruct(u64);`. rustfmt will no longer format `MyStruct { 0: 0 }` as `MyStruct { 0 }` [#5488](https://github.com/rust-lang/rustfmt/issues/5488)
25102
- rustfmt no longer panics when formatting an empty code block in a doc comment with `format_code_in_doc_comments = true` [#5234](https://github.com/rust-lang/rustfmt/issues/5234). For example:
@@ -108,7 +185,7 @@
108185

109186
- Simplify the rustfmt help text by eliding the full path to the rustfmt binary path from the usage string when running `rustfmt --help` [#5214](https://github.com/rust-lang/rustfmt/issues/5214)
110187

111-
- Bumped the version for serveral dependencies. Most notably `dirs` `v2.0.1` -> `v4.0.0`. This changed the global user config directory on macOS from `$HOME/Library/Preferences` to `$HOME/Library/Application Support` [#5237](https://github.com/rust-lang/rustfmt/pull/5237)
188+
- Bumped the version for several dependencies. Most notably `dirs` `v2.0.1` -> `v4.0.0`. This changed the global user config directory on macOS from `$HOME/Library/Preferences` to `$HOME/Library/Application Support` [#5237](https://github.com/rust-lang/rustfmt/pull/5237)
112189

113190
### Fixed
114191

@@ -866,7 +943,7 @@ from formatting an attribute #3665
866943

867944
### Fixed
868945

869-
- Do not remove path disambiugator inside macro #3142
946+
- Do not remove path disambiguator inside macro #3142
870947
- Improve handling of Windows newlines #3141
871948
- Fix alignment of a struct's fields (`struct_field_align_threshold` option) with the Visual `indent_style` #3165
872949
- Fix a bug in formatting markdown lists within comments #3172
@@ -955,7 +1032,7 @@ from formatting an attribute #3665
9551032

9561033
### Changed
9571034

958-
- Replace '--conifig-help' with '--config=help' cb10e06
1035+
- Replace '--config-help' with '--config=help' cb10e06
9591036
- Improve formatting of slice patterns #2912
9601037

9611038
### Fixed
@@ -999,7 +1076,7 @@ from formatting an attribute #3665
9991076
- Add max_width option for all heuristics c2ae39e
10001077
- Add config option `format_macro_matchers` to format the metavariable matching patterns in macros 79c5ee8
10011078
- Add config option `format_macro_bodies` to format the bodies of macros 79c5ee8
1002-
- Format exitential type fc307ff
1079+
- Format existential type fc307ff
10031080
- Support raw identifiers in struct expressions f121b1a
10041081
- Format Async block and async function 0b25f60
10051082

@@ -1055,7 +1132,7 @@ from formatting an attribute #3665
10551132

10561133
### Changed
10571134

1058-
- Update rustc-ap-syntax to 128.0.0 and ustc-ap-rustc_target to 128.0.0 195395f
1135+
- Update rustc-ap-syntax to 128.0.0 and rustc-ap-rustc_target to 128.0.0 195395f
10591136
- Put operands on its own line when each fits in a single line f8439ce
10601137
- Improve CLI options 55ac062 1869888 798bffb 4d9de48 eca7796 8396da1 5d9f5aa
10611138

@@ -1119,7 +1196,7 @@ from formatting an attribute #3665
11191196
- Do not collapse block around expr with condition on match arm 5b9b7d5
11201197
- Use vertical layout for complex attributes c77708f
11211198
- Format array using heuristics for function calls 98c6f7b
1122-
- Implement stable ordering for impl items with the the following item priority: type, const, macro, then method fa80ddf
1199+
- Implement stable ordering for impl items with the following item priority: type, const, macro, then method fa80ddf
11231200
- Reorder imports by default 164cf7d
11241201
- Group `extern crate` by default 3a138a2
11251202
- Make `error_on_line_overflow` false by default f146711

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A version of this document [can be found online](https://www.rust-lang.org/condu
1111
* Please be kind and courteous. There's no need to be mean or rude.
1212
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
1313
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
14-
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the <a href="http://citizencodeofconduct.org/">Citizen Code of Conduct</a>; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
14+
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the <a href="https://github.com/stumpsyn/policies/blob/master/citizen_code_of_conduct.md/">Citizen Code of Conduct</a>; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
1515
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [Rust moderation team][mod_team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back.
1616
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
1717

0 commit comments

Comments
 (0)