-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't enable unstable features #4353
Comments
This seems potentially related to #3872, in that the decision to print a warning or enable the feature should be deferred until after parsing the entire config |
Thanks for reaching out @austinglaser. TL;DR - You cannot use unstable features on stable with rustfmt 1.x, and the link you referenced in the issue description is for a different/newer version of rustfmt than the version you are actually using (v1.4.15) From the Configuring Rustfmt section of the readme (emphasis mine):
When looking at the configuration page, make sure to use the version selection dropdown to pick the version of rustfmt you are using. Direct link to config docs for v1.4.15 Direct link to |
Ah, I missed the "starting in rustfmt v2.0." Thanks very much! |
Since rustfmt 2.0 will not be available via rustup/to the general developer population anytime soon, would you consider enabling something like this for the 1.x releases? Maybe using something like I'll be willing to contribute to the implementation of such feature, since there are multiple unstable features I'd like to use for my own code, and I don't mind occasional breaking changes in formatting. |
OK, thanks for the answer. I see where the teams are coming from, but for me that mean using rustfmt is harder for me. The default output have less than ideal for my code since the first version. Nowadays, the unstable configuration options are enough for me to consider using it again; but I can not move the whole team on nightly just to be able to use the formatter. I guess the other option is to work toward stabilizing the options I would like to use. Is there any way I can help to make them stable faster? |
@calebcartwright Sorry to necrobump, but the mythical |
Describe the bug
rustfmt
does not appear to accept theunstable_features = true
option (documented here) inrustfmt.toml
To Reproduce
rustfmt.toml
:rustfmt
Interestingly, I cannot override this on the command line:
If I change
rustfmt.toml
to simply beI get
However, with an empty rustfmt.toml, the following works:
So it looks like perhaps this is associated solely with loading the config?
Expected behavior
When
unstable_features = true
is set inrustfmt.toml
,rustfmt
should accept and act on unstable options likemerge_imports
without producing warnings.Furthermore, a command-line specification of
--config unstable_features=true
should enable unstable features when loaded fromrustfmt.toml
Meta
rustfmt 1.4.15-stable (530eadf4 2020-06-02)
cargo fmt
and editor on-save hooks, but see aboveThe text was updated successfully, but these errors were encountered: