Skip to content
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

rustc: Refactor how unstable flags are handled #31793

Merged
merged 1 commit into from
Feb 25, 2016

Conversation

alexcrichton
Copy link
Member

This commit adds support for truly unstable options in the compiler, as well
as adding warnings for the start of the deprecation path of
unstable-but-not-really options. Specifically, the following behavior is now in
place for handling unstable options:

  • As before, an unconditional error is emitted if an unstable option is passed
    and the -Z unstable-options flag is not present. Note that passing another
    -Z flag does not require passing -Z unstable-options as well.
  • New flags added to the compiler will be in the Unstable category as opposed
    to the UnstableButNotReally category which means they will unconditionally
    emit an error when used on stable.
  • All current flags are in a category where they will emit warnings when used
    that the option will soon be a hard error.

Also as before, it is intended that -Z is akin to #![feature] in a crate
where it is required to unlock unstable functionality. A nightly compiler which
is used without any -Z flags should only be exercising stable behavior.

@rust-highfive
Copy link
Collaborator

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

Note that this PR has no functional changes from today's compiler except that usage of -Z on the stable channel will now emit a warning. I would hope that over time we can use this as a metric for what -Z flags really need to be stabilized, and we can stabilize some of the -Z flags in other locations.

@nikomatsakis
Copy link
Contributor

@alexcrichton seems like a great start to me.

// FIXME (pnkfelix): We default to stable since the current set of
// options is defacto stable. However, it would be good to revise the
// code so that a stable option is the thing that takes extra effort
// to encode.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by this FIXME -- in what sense do we "default" to stable below?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

er, did we?

@nikomatsakis
Copy link
Contributor

Is it worth adding a run-make test or something like that?

@nikomatsakis nikomatsakis assigned nikomatsakis and unassigned nrc Feb 21, 2016
@nikomatsakis
Copy link
Contributor

I'll take the review since @nrc is on vacation.

@alexcrichton
Copy link
Member Author

I was hoping I could add a test of some form, but I couldn't really think of a way to do so unfortunately. We don't have a way to say "dear compiler, please pretend you are a stable compiler" in a reliable fashion. Although I guess one could be added?

@alexcrichton alexcrichton force-pushed the add-real-option-gating branch 2 times, most recently from b48cb7e to bd1579c Compare February 21, 2016 18:18
@alexcrichton
Copy link
Member Author

One part of our discussion at the core team meeting as well was to not warn for now until the stable replacements existed, but thinking more on that it might be nice to start warning immediately to get feedback on what needs to be stabilized. Worth making sure that we want to do this, though.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 23, 2016

📌 Commit 3f187b9 has been approved by nikomatsakis

@nikomatsakis nikomatsakis added the relnotes Marks issues that should be documented in the release notes of the next release. label Feb 23, 2016
@bors
Copy link
Contributor

bors commented Feb 24, 2016

⌛ Testing commit 3f187b9 with merge 6d91818...

@bors
Copy link
Contributor

bors commented Feb 24, 2016

💔 Test failed - auto-mac-64-opt

@pnkfelix
Copy link
Member

@alexcrichton that bors failure looks (plausibly) legitimate to me.

This commit adds support for *truly* unstable options in the compiler, as well
as adding warnings for the start of the deprecation path of
unstable-but-not-really options. Specifically, the following behavior is now in
place for handling unstable options:

* As before, an unconditional error is emitted if an unstable option is passed
  and the `-Z unstable-options` flag is not present. Note that passing another
  `-Z` flag does not require passing `-Z unstable-options` as well.
* New flags added to the compiler will be in the `Unstable` category as opposed
  to the `UnstableButNotReally` category which means they will unconditionally
  emit an error when used on stable.
* All current flags are in a category where they will emit warnings when used
  that the option will soon be a hard error.

Also as before, it is intended that `-Z` is akin to `#![feature]` in a crate
where it is required to unlock unstable functionality. A nightly compiler which
is used without any `-Z` flags should only be exercising stable behavior.
@alexcrichton
Copy link
Member Author

@bors: r=nikomatsakis 1282833

legit indeed!

@bors
Copy link
Contributor

bors commented Feb 24, 2016

⌛ Testing commit 1282833 with merge 9f39abe...

@bors
Copy link
Contributor

bors commented Feb 24, 2016

💔 Test failed - auto-win-gnu-32-nopt-t

@alexcrichton
Copy link
Member Author

@bors: retry

On Wed, Feb 24, 2016 at 1:00 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-win-gnu-32-nopt-t
http://buildbot.rust-lang.org/builders/auto-win-gnu-32-nopt-t/builds/3211


Reply to this email directly or view it on GitHub
#31793 (comment).

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 25, 2016
…, r=nikomatsakis

This commit adds support for *truly* unstable options in the compiler, as well
as adding warnings for the start of the deprecation path of
unstable-but-not-really options. Specifically, the following behavior is now in
place for handling unstable options:

* As before, an unconditional error is emitted if an unstable option is passed
  and the `-Z unstable-options` flag is not present. Note that passing another
  `-Z` flag does not require passing `-Z unstable-options` as well.
* New flags added to the compiler will be in the `Unstable` category as opposed
  to the `UnstableButNotReally` category which means they will unconditionally
  emit an error when used on stable.
* All current flags are in a category where they will emit warnings when used
  that the option will soon be a hard error.

Also as before, it is intended that `-Z` is akin to `#![feature]` in a crate
where it is required to unlock unstable functionality. A nightly compiler which
is used without any `-Z` flags should only be exercising stable behavior.
bors added a commit that referenced this pull request Feb 25, 2016
@bors
Copy link
Contributor

bors commented Feb 25, 2016

⌛ Testing commit 1282833 with merge 8d30ee4...

@bors
Copy link
Contributor

bors commented Feb 25, 2016

💔 Test failed - auto-linux-64-nopt-t

@alexcrichton
Copy link
Member Author

@bors: retry

On Thu, Feb 25, 2016 at 7:04 AM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-linux-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/8173


Reply to this email directly or view it on GitHub
#31793 (comment).

@bors bors merged commit 1282833 into rust-lang:master Feb 25, 2016
@alexcrichton alexcrichton deleted the add-real-option-gating branch February 25, 2016 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants