Skip to content

Commit cf21bfc

Browse files
committed
Add new configuration option abort_on_unrecognised_options
This option was proposed in issue 5022
1 parent f7c4a44 commit cf21bfc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Configurations.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or
1717

1818
Below you find a detailed visual guide on all the supported configuration options of rustfmt:
1919

20+
## `abort_on_unrecognised_options`
21+
22+
Exit early when using nightly only options on the stable channel
23+
24+
- **Default value**: `false`
25+
- **Possible values**: `true`, `false`
26+
- **Stable**: No (tracking issue: #5022)
27+
28+
2029
## `array_width`
2130

2231
Maximum width of an array literal before falling back to vertical formatting.

src/config/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ create_config! {
168168
"Report all, none or unnumbered occurrences of FIXME in source file comments";
169169
ignore: IgnoreList, IgnoreList::default(), false,
170170
"Skip formatting the specified files and directories";
171+
abort_on_unrecognised_options: bool, false, false,
172+
"Exit early when using nightly only options on the stable channel";
171173

172174
// Not user-facing
173175
verbose: Verbosity, Verbosity::Normal, false, "How much to information to emit to the user";
@@ -625,6 +627,7 @@ error_on_unformatted = false
625627
report_todo = "Never"
626628
report_fixme = "Never"
627629
ignore = []
630+
abort_on_unrecognised_options = false
628631
emit_mode = "Files"
629632
make_backup = false
630633
"#,

0 commit comments

Comments
 (0)