Skip to content

unstable features are usable on stable with the '--config' option #4081

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
bmwill opened this issue Mar 12, 2020 · 2 comments · Fixed by #4228
Closed

unstable features are usable on stable with the '--config' option #4081

bmwill opened this issue Mar 12, 2020 · 2 comments · Fixed by #4228
Labels
bug Panic, non-idempotency, invalid code, etc.
Milestone

Comments

@bmwill
Copy link

bmwill commented Mar 12, 2020

If you place an unstable config in a rustfmt.toml config file and run
using a stable version of rustfmt the config is ignored and you get the
following:

$ cargo fmt
Warning: can't set `merge_imports = true`, unstable features are only available in nightly channel.

But if you instead pass the config using the '--config' option rustfmt
happily applies and uses the unstable config:

$ cargo fmt -- --config merge_imports=true

I don't know if this is intentional or not but it gave me a workaround for using the 'merge_imports' feature while using a stable toolchain: diem/diem#2926

@calebcartwright
Copy link
Member

calebcartwright commented Mar 13, 2020

Yeah I noticed this the other day too (#4064 (comment)). I don't think it's intentional currently, and it's possible that cli config override support for unstable options on stable will be dropped as part of the rustfmt 2.x release

@topecongiro topecongiro added the bug Panic, non-idempotency, invalid code, etc. label Apr 17, 2020
@topecongiro topecongiro added this to the 2.0.0 milestone Apr 17, 2020
@calebcartwright
Copy link
Member

@topecongiro are we planning to remove this (unstable opts on stable via --config) for the 2.0 release?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants