Skip to content

add 'unstable options' command line option #1975

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

Closed
nrc opened this issue Sep 18, 2017 · 5 comments
Closed

add 'unstable options' command line option #1975

nrc opened this issue Sep 18, 2017 · 5 comments
Labels
good first issue Issues up for grabs, also good candidates for new rustfmt contributors
Milestone

Comments

@nrc
Copy link
Member

nrc commented Sep 18, 2017

No description provided.

@nrc nrc added this to the impl period milestone Sep 18, 2017
@nrc nrc added the good first issue Issues up for grabs, also good candidates for new rustfmt contributors label Sep 18, 2017
@nrc nrc mentioned this issue Sep 18, 2017
10 tasks
@ssilva
Copy link
Contributor

ssilva commented Sep 20, 2017

Hi Nick, this might be something I can tackle. Where can I find more info about this bug (rationale/context)?

@nrc
Copy link
Member Author

nrc commented Sep 20, 2017

So the motivation here is that when we are distributed with Rustup there will be both nightly (unstable) and other (stable) versions of Rustfmt. To get the unstable features, the user will have to opt-in by running rustfmt --unstable-features. This flag will only be available to nightly users (much like the feature flag system in Rust).

In terms of implementation there are a few steps:

  • add the flag itself (this should be pretty easy)
  • ensure the flag can be set programmatically when rustfmt is used as a library
  • decide what should be unstable (this can be ongoing, but needs to be done by the time we use Rustup)
  • for each unstable feature, ensure that you need the --unstable-features flag. This includes any unstable configuration options (we would need some mechanism for marking options as stable or unstable)
  • only allow the flag to be set if we are run with nightly (see the RLS for an example of how to do this)

@tmahmood
Copy link

Hi Nick, I have sent a PR for this issue. Sorry for not communicating beforehand.

I have question about this one.

only allow the flag to be set if we are run with nightly (see the RLS for an example of how to do this)

I have used CFG_RELEASE_CHANNEL to detect which version of rust we are using. Is this right approach? I didn't felt it was very reliable.

@nrc
Copy link
Member Author

nrc commented Sep 29, 2017

I have used CFG_RELEASE_CHANNEL to detect which version of rust we are using. Is this right approach?

Yes, that is good.

@nrc
Copy link
Member Author

nrc commented Oct 29, 2017

Closed by #1998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues up for grabs, also good candidates for new rustfmt contributors
Projects
None yet
Development

No branches or pull requests

4 participants