Skip to content

Commit 6017483

Browse files
committed
rustfmt: gate assigning style-edition on nightly as well
The `style-edition` is declared as a nightly option, but later we attempt to read the value of the `style-edition` even when we are not on the nightly channel, causing a panic on e.g. beta.
1 parent 7e7282e commit 6017483

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tools/rustfmt/src/bin/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,10 @@ impl GetOptsOptions {
654654
}
655655
}
656656

657-
if let Some(ref edition_str) = matches.opt_str("style-edition") {
658-
options.style_edition = Some(style_edition_from_style_edition_str(edition_str)?);
657+
if is_nightly() {
658+
if let Some(ref edition_str) = matches.opt_str("style-edition") {
659+
options.style_edition = Some(style_edition_from_style_edition_str(edition_str)?);
660+
}
659661
}
660662

661663
Ok(options)

0 commit comments

Comments
 (0)