Skip to content

Commit 312a86b

Browse files
Merge remote-tracking branch 'upstream/master' into subtree-sync-2023-06-19
2 parents 48e380f + f4201ef commit 312a86b

Some content is hidden

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

49 files changed

+1644
-362
lines changed

.editorconfig

-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ indent_size = unset
2121
indent_style = unset
2222
trim_trailing_whitespace = unset
2323
insert_final_newline = unset
24-
25-
[appveyor.yml]
26-
end_of_line = unset

.github/workflows/upload-assets.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ jobs:
4646
shell: bash
4747

4848
- name: Build release binaries
49-
uses: actions-rs/cargo@v1
50-
with:
51-
command: build
52-
args: --release
49+
run: cargo build --release
5350

5451
- name: Build archive
5552
shell: bash

.travis.yml

-77
This file was deleted.

CHANGELOG.md

+63
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,67 @@
22

33
## [Unreleased]
44

5+
### Fixed
6+
7+
- When formatting doc comments with `wrap_comments = true` rustfmt will no longer wrap markdown tables [#4210](https://github.com/rust-lang/rustfmt/issues/4210)
8+
- rustfmt will no longer use shorthand initialization when rewriting a tuple struct even when `use_field_init_shorthand = true` as this lead to code that could no longer compile.
9+
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)
10+
- 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:
11+
```rust
12+
/// ```
13+
///
14+
/// ```
15+
fn main() {}
16+
```
17+
- Use the correct span when rewriting struct generics. This prevents rustfmt from incorrectly duplicating where clause bounds when using const expression in where clause bounds with feature `#![feature(generic_const_exprs)]` [#5691](https://github.com/rust-lang/rustfmt/issues/5691). e.g.:
18+
```rust
19+
struct S<const C: usize>
20+
where
21+
[(); { num_slots!(C) }]:, {
22+
// code ...
23+
}
24+
```
25+
26+
### Changed
27+
28+
- Users can now control whether rustc parser errors are displayed with color using rustfmt's `--color` option. To disable colored errors pass `--color=Never` to rustfmt [#5717](https://github.com/rust-lang/rustfmt/issues/5717)
29+
30+
31+
### Added
32+
33+
- rustfmt now recognises `+` as the start of a markdown list, and won't incorrectly wrap sublists that begin with `+` when formatting doc comments with `wrap_comments = true` [#5560](https://github.com/rust-lang/rustfmt/pull/5560)
34+
35+
### Misc
36+
37+
- Prevent ICE when parsing invalid attributes in `cfg_if!` macros [#5728](https://github.com/rust-lang/rustfmt/issues/5728)
38+
39+
40+
## [1.5.2] 2023-01-24
41+
42+
### Fixed
43+
44+
- Resolve issue when comments are found within const generic defaults in unit structs [#5668](https://github.com/rust-lang/rustfmt/issues/5668)
45+
- Resolve issue when block comments are found within trait generics [#5358](https://github.com/rust-lang/rustfmt/issues/5358)
46+
- Correctly handle alignment of comments containing unicode characters [#5504](https://github.com/rust-lang/rustfmt/issues/5504)
47+
- Properly indent a single generic bound that requires being written across multiple lines [#4689](https://github.com/rust-lang/rustfmt/issues/4689) (n.b. this change is version gated and will only appear when the `version` configuration option is set to `Two`)
48+
49+
### Changed
50+
51+
- Renamed `fn_args_layout` configuration option to `fn_params_layout` [#4149](https://github.com/rust-lang/rustfmt/issues/4149). Note that `fn_args_layout` has only been soft deprecated: `fn_args_layout` will continue to work without issue, but rustfmt will display a warning to encourage users to switch to the new name
52+
53+
### Added
54+
55+
- New configuration option (`skip_macro_invocations`)[https://rust-lang.github.io/rustfmt/?version=master&search=#skip_macro_invocations] [#5347](https://github.com/rust-lang/rustfmt/pull/5347) that can be used to globally define a single enumerated list of macro calls that rustfmt should skip formatting. rustfmt [currently also supports this via a custom tool attribute](https://github.com/rust-lang/rustfmt#tips), however, these cannot be used in all contexts because [custom inner attributes are unstable](https://github.com/rust-lang/rust/issues/54726)
56+
57+
### Misc
58+
59+
- rustfmt now internally supports the ability to have both stable and unstable variants of a configuration option [#5378](https://github.com/rust-lang/rustfmt/issues/5378). This ability will allow the rustfmt team to make certain configuration options available on stable toolchains more quickly because we no longer have to wait for _every_ variant to be stable-ready before stabilizing _any_ variant.
60+
61+
### Install/Download Options
62+
- **rustup (nightly)** - nightly-2023-01-24
63+
- **GitHub Release Binaries** - [Release v1.5.2](https://github.com/rust-lang/rustfmt/releases/tag/v1.5.2)
64+
- **Build from source** - [Tag v1.5.2](https://github.com/rust-lang/rustfmt/tree/v1.5.2), see instructions for how to [install rustfmt from source][install-from-source]
65+
566
## [1.5.2] 2023-01-24
667

768
### Fixed
@@ -56,6 +117,8 @@
56117

57118
- 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)
58119

120+
- 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)
121+
59122
### Fixed
60123

61124
- Remove duplicate imports when `imports_granularity` is set to `Item` [#4725](https://github.com/rust-lang/rustfmt/issues/4725)

0 commit comments

Comments
 (0)