Skip to content

Commit 293d7d0

Browse files
meta: bump version to v1.4.26
1 parent 77c8c90 commit 293d7d0

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

Diff for: CHANGELOG.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,55 @@
22

33
## [Unreleased]
44

5+
## [1.4.26] 2020-11-14
6+
7+
### Changed
8+
9+
- 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))
10+
11+
In this example the `// else comment` refers to the `else`:
12+
```rust
13+
// if comment
14+
if cond {
15+
"if"
16+
// else comment
17+
} else {
18+
"else"
19+
}
20+
```
21+
22+
Whereas in this case the `// continue` comments are members of their respective blocks and do not refer to the `else` below.
23+
```rust
24+
if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"))? {
25+
if toks.eat_token(Token::Colon)? {
26+
// ate the token
27+
} else if toks.eat_token(Token::Word("to"))? {
28+
// optionally eat the colon after to, e.g.:
29+
// @rustbot modify labels to: -S-waiting-on-author, +S-waiting-on-review
30+
toks.eat_token(Token::Colon)?;
31+
} else {
32+
// It's okay if there's no to or colon, we can just eat labels
33+
// afterwards.
34+
}
35+
1 + 2;
36+
// continue
37+
} else if toks.eat_token(Token::Word("label"))? {
38+
// continue
39+
} else {
40+
return Ok(None);
41+
}
42+
```
43+
44+
### Fixed
45+
- 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))
46+
- Indentation of trailing comments in non-empty extern blocks is now correct. ([#4120](https://github.com/rust-lang/rustfmt/issues/4120#issuecomment-696491872))
47+
48+
### Install/Download Options
49+
- **crates.io package** - *pending*
50+
- **rustup (nightly)** - *pending*
51+
- **GitHub Release Binaries** - [Release v1.4.26](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.26)
52+
- **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]
53+
554
## [1.4.25] 2020-11-10
655

756
### Changed
@@ -10,7 +59,7 @@
1059

1160
### Install/Download Options
1261
- **crates.io package** - *pending*
13-
- **rustup (nightly)** - *pending*
62+
- **rustup (nightly)** - Starting in `2020-11-14`
1463
- **GitHub Release Binaries** - [Release v1.4.25](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.25)
1564
- **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]
1665

Diff for: Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "rustfmt-nightly"
4-
version = "1.4.25"
4+
version = "1.4.26"
55
authors = ["Nicholas Cameron <[email protected]>", "The Rustfmt developers"]
66
description = "Tool to find and fix Rust formatting issues"
77
repository = "https://github.com/rust-lang/rustfmt"

0 commit comments

Comments
 (0)