Skip to content

Commit 41aac15

Browse files
Merge branch 'master' into master
2 parents 3570a72 + 34f9ca2 commit 41aac15

Some content is hidden

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

60 files changed

+857
-291
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
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/integration.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
tempdir,
2828
futures-rs,
2929
rust-clippy,
30-
failure,
3130
]
3231
include:
3332
# Allowed Failures
@@ -63,9 +62,6 @@ jobs:
6362
# Original comment was: temporal build failure due to breaking changes in the nightly compiler
6463
- integration: rust-semverver
6564
allow-failure: true
66-
# Can be moved back to include section after https://github.com/rust-lang-nursery/failure/pull/298 is merged
67-
- integration: failure
68-
allow-failure: true
6965

7066
steps:
7167
- name: checkout

.github/workflows/upload-assets.yml

Lines changed: 1 addition & 4 deletions
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

Lines changed: 0 additions & 77 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
## [Unreleased]
44

5+
## [1.5.2] 2023-01-24
6+
7+
### Fixed
8+
9+
- Resolve issue when comments are found within const generic defaults in unit structs [#5668](https://github.com/rust-lang/rustfmt/issues/5668)
10+
- Resolve issue when block comments are found within trait generics [#5358](https://github.com/rust-lang/rustfmt/issues/5358)
11+
- Correctly handle alignment of comments containing unicode characters [#5504](https://github.com/rust-lang/rustfmt/issues/5504)
12+
- 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`)
13+
14+
### Changed
15+
16+
- 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
17+
18+
### Added
19+
20+
- 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)
21+
22+
### Misc
23+
24+
- 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.
25+
26+
### Install/Download Options
27+
- **rustup (nightly)** - nightly-2023-01-24
28+
- **GitHub Release Binaries** - [Release v1.5.2](https://github.com/rust-lang/rustfmt/releases/tag/v1.5.2)
29+
- **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]
30+
531
## [1.5.1] 2022-06-24
632

733
**N.B** A bug was introduced in v1.5.0/nightly-2022-06-15 which modified formatting. If you happened to run rustfmt over your code with one of those ~10 nightlies it's possible you may have seen formatting changes, and you may see additional changes after this fix since that bug has now been reverted.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "rustfmt-nightly"
4-
version = "1.5.1"
4+
version = "1.5.2"
55
description = "Tool to find and fix Rust formatting issues"
66
repository = "https://github.com/rust-lang/rustfmt"
77
readme = "README.md"

Configurations.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ fn example() {
425425

426426
## `comment_width`
427427

428-
Maximum length of comments. No effect unless`wrap_comments = true`.
428+
Maximum length of comments. No effect unless `wrap_comments = true`.
429429

430430
- **Default value**: `80`
431431
- **Possible values**: any positive integer
@@ -2997,6 +2997,10 @@ See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_s
29972997

29982998
Break comments to fit on the line
29992999

3000+
Note that no wrapping will happen if:
3001+
1. The comment is the start of a markdown header doc comment
3002+
2. An URL was found in the comment
3003+
30003004
- **Default value**: `false`
30013005
- **Possible values**: `true`, `false`
30023006
- **Stable**: No (tracking issue: [#3347](https://github.com/rust-lang/rustfmt/issues/3347))
@@ -3011,6 +3015,11 @@ Break comments to fit on the line
30113015
// commodo consequat.
30123016

30133017
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
3018+
3019+
// Information on the lorem ipsum can be found at the following url: https://en.wikipedia.org/wiki/Lorem_ipsum. Its text is: lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
3020+
3021+
/// # This doc comment is a very long header (it starts with a '#'). Had it not been a header it would have been wrapped. But because it is a header, it will not be. That is because wrapping a markdown header breaks it.
3022+
struct Foo {}
30143023
```
30153024

30163025
#### `true`:
@@ -3021,6 +3030,17 @@ Break comments to fit on the line
30213030
// magna aliqua. Ut enim ad minim veniam, quis nostrud
30223031
// exercitation ullamco laboris nisi ut aliquip ex ea
30233032
// commodo consequat.
3033+
3034+
// Lorem ipsum dolor sit amet, consectetur adipiscing elit,
3035+
// sed do eiusmod tempor incididunt ut labore et dolore
3036+
// magna aliqua. Ut enim ad minim veniam, quis nostrud
3037+
// exercitation ullamco laboris nisi ut aliquip ex ea
3038+
// commodo consequat.
3039+
3040+
// Information on the lorem ipsum can be found at the following url: https://en.wikipedia.org/wiki/Lorem_ipsum. Its text is: lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
3041+
3042+
/// # This doc comment is a very long header (it starts with a '#'). Had it not been a header it would have been wrapped. But because it is a header, it will not be. That is because wrapping a markdown header breaks it.
3043+
struct Foo {}
30243044
```
30253045

30263046
# Internal Options

Processes.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,3 @@ git tag -s v1.2.3 -m "Release 1.2.3"
5151
`cargo publish`
5252

5353
## 5. Create a PR to rust-lang/rust to update the rustfmt submodule
54-
55-
Note that if you are updating `rustc-ap-*` crates, then you need to update **every** submodules in the rust-lang/rust repository that depend on the crates to use the same version of those.
56-
57-
As of 2019/05, there are two such crates: `rls` and `racer` (`racer` depends on `rustc-ap-syntax` and `rls` depends on `racer`, and `rls` is one of submodules of the rust-lang/rust repository).

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# rustfmt [![Build Status](https://travis-ci.com/rust-lang/rustfmt.svg?branch=master)](https://travis-ci.com/rust-lang/rustfmt) [![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-lang/rustfmt?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/rustfmt) [![crates.io](https://img.shields.io/crates/v/rustfmt-nightly.svg)](https://crates.io/crates/rustfmt-nightly) [![Travis Configuration Status](https://img.shields.io/travis/davidalber/rustfmt-travis.svg?label=travis%20example)](https://travis-ci.org/davidalber/rustfmt-travis)
1+
# rustfmt [![linux](https://github.com/rust-lang/rustfmt/actions/workflows/linux.yml/badge.svg?event=push)](https://github.com/rust-lang/rustfmt/actions/workflows/linux.yml) [![mac](https://github.com/rust-lang/rustfmt/actions/workflows/mac.yml/badge.svg?event=push)](https://github.com/rust-lang/rustfmt/actions/workflows/mac.yml) [![windows](https://github.com/rust-lang/rustfmt/actions/workflows/windows.yml/badge.svg?event=push)](https://github.com/rust-lang/rustfmt/actions/workflows/windows.yml) [![crates.io](https://img.shields.io/crates/v/rustfmt-nightly.svg)](https://crates.io/crates/rustfmt-nightly)
22

33
A tool for formatting Rust code according to style guidelines.
44

@@ -7,9 +7,7 @@ If you'd like to help out (and you should, it's a fun project!), see
77
Conduct](CODE_OF_CONDUCT.md).
88

99
You can use rustfmt in Travis CI builds. We provide a minimal Travis CI
10-
configuration (see [here](#checking-style-on-a-ci-server)) and verify its status
11-
using another repository. The status of that repository's build is reported by
12-
the "travis example" badge above.
10+
configuration (see [here](#checking-style-on-a-ci-server)).
1311

1412
## Quick start
1513

@@ -135,7 +133,7 @@ completed without error (whether or not changes were made).
135133
* [Emacs](https://github.com/rust-lang/rust-mode)
136134
* [Sublime Text 3](https://packagecontrol.io/packages/RustFmt)
137135
* [Atom](atom.md)
138-
* Visual Studio Code using [vscode-rust](https://github.com/editor-rs/vscode-rust), [vsc-rustfmt](https://github.com/Connorcpu/vsc-rustfmt) or [rls_vscode](https://github.com/jonathandturner/rls_vscode) through RLS.
136+
* [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
139137
* [IntelliJ or CLion](intellij.md)
140138

141139

0 commit comments

Comments
 (0)