Skip to content

Commit 1eacf2c

Browse files
Merge branch 'master' into feat/#6063/use-semver-to-check-required-version
2 parents afdef69 + 2ad782c commit 1eacf2c

File tree

187 files changed

+3100
-838
lines changed

Some content is hidden

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

187 files changed

+3100
-838
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
use std::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64};
4040
```
4141
[style guide's version sorting algorithm]: https://doc.rust-lang.org/nightly/style-guide/#sorting
42-
- When parsing rustfmt configurations fails, rustfmt will now include the path to the toml file in the erorr message [#6302](https://github.com/rust-lang/rustfmt/issues/6302)
42+
- When parsing rustfmt configurations fails, rustfmt will now include the path to the toml file in the error message [#6302](https://github.com/rust-lang/rustfmt/issues/6302)
4343

4444
### Added
4545
- rustfmt now formats trailing where clauses in type aliases [#5887](https://github.com/rust-lang/rustfmt/pull/5887)
@@ -133,7 +133,7 @@
133133
### Changed
134134

135135
- `hide_parse_errors` has been soft deprecated and it's been renamed to `show_parse_errors` [#5961](https://github.com/rust-lang/rustfmt/pull/5961).
136-
- The diff output produced by `rustfmt --check` is more compatable with editors that support navigating directly to line numbers [#5971](https://github.com/rust-lang/rustfmt/pull/5971)
136+
- The diff output produced by `rustfmt --check` is more compatible with editors that support navigating directly to line numbers [#5971](https://github.com/rust-lang/rustfmt/pull/5971)
137137
- When using `version=Two`, the `trace!` macro from the [log crate] is now formatted similarly to `debug!`, `info!`, `warn!`, and `error!` [#5987](https://github.com/rust-lang/rustfmt/issues/5987).
138138

139139
[log crate]: https://crates.io/crates/log

Cargo.lock

Lines changed: 7 additions & 16 deletions
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
@@ -33,7 +33,7 @@ rustfmt-format-diff = []
3333
generic-simd = ["bytecount/generic-simd"]
3434

3535
[dependencies]
36-
annotate-snippets = { version = "0.9", features = ["color"] }
36+
annotate-snippets = { version = "0.11" }
3737
anyhow = "1.0"
3838
bytecount = "0.6.8"
3939
cargo_metadata = "0.18"

Configurations.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,56 @@ Control the case of the letters in hexadecimal literal values
12561256
- **Possible values**: `Preserve`, `Upper`, `Lower`
12571257
- **Stable**: No (tracking issue: [#5081](https://github.com/rust-lang/rustfmt/issues/5081))
12581258

1259+
## `float_literal_trailing_zero`
1260+
1261+
Control the presence of trailing zero in floating-point literal values
1262+
1263+
- **Default value**: `Preserve`
1264+
- **Possible values**: `Preserve`, `Always`, `IfNoPostfix`, `Never`
1265+
- **Stable**: No (tracking issue: [#6471](https://github.com/rust-lang/rustfmt/issues/6471))
1266+
1267+
#### `Preserve` (default):
1268+
1269+
Leave the literal as-is.
1270+
1271+
```rust
1272+
fn main() {
1273+
let values = [1.0, 2., 3.0e10, 4f32];
1274+
}
1275+
```
1276+
1277+
#### `Always`:
1278+
1279+
Add a trailing zero to the literal:
1280+
1281+
```rust
1282+
fn main() {
1283+
let values = [1.0, 2.0, 3.0e10, 4.0f32];
1284+
}
1285+
```
1286+
1287+
#### `IfNoPostfix`:
1288+
1289+
Add a trailing zero by default. If the literal contains an exponent or a suffix, the zero
1290+
and the preceding period are removed:
1291+
1292+
```rust
1293+
fn main() {
1294+
let values = [1.0, 2.0, 3e10, 4f32];
1295+
}
1296+
```
1297+
1298+
#### `Never`:
1299+
1300+
Remove the trailing zero. If the literal contains an exponent or a suffix, the preceding
1301+
period is also removed:
1302+
1303+
```rust
1304+
fn main() {
1305+
let values = [1., 2., 3e10, 4f32];
1306+
}
1307+
```
1308+
12591309
## `hide_parse_errors`
12601310

12611311
This option is deprecated and has been renamed to `show_parse_errors` to avoid confusion around the double negative default of `hide_parse_errors=false`.
@@ -3167,7 +3217,7 @@ Break comments to fit on the line
31673217

31683218
Note that no wrapping will happen if:
31693219
1. The comment is the start of a markdown header doc comment
3170-
2. An URL was found in the comment
3220+
2. A URL was found in the comment
31713221

31723222
- **Default value**: `false`
31733223
- **Possible values**: `true`, `false`

check_diff/Cargo.lock

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

check_diff/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ edition = "2021"
99
clap = { version = "4.4.2", features = ["derive"] }
1010
tracing = "0.1.37"
1111
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
12-
[dev-dependencies]
1312
tempfile = "3"
13+
walkdir = "2.5.0"
14+
diffy = "0.4.0"

0 commit comments

Comments
 (0)