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

add -C overflow-checks option #40037

Merged
merged 1 commit into from Feb 25, 2017
Merged

Conversation

froydnj
Copy link
Contributor

@froydnj froydnj commented Feb 22, 2017

In addition to defining and handling the new option, we also add a method on librustc::Session for determining the necessity of overflow checks. This method provides a single point to sort out the three (!) different ways for turning on overflow checks: -C debug-assertions, -C overflow-checks, and -Z force-overflow-checks.

I was seeing a run-pass/issue-28950.rs failure on my machine with these patches, but I was also seeing the failure without the changes to the core compiler. We'll see what travis says.

Fixes #33134. r? @alexcrichton

In addition to defining and handling the new option, we also add a
method on librustc::Session for determining the necessity of overflow
checks.  This method provides a single point to sort out the three (!)
different ways for turning on overflow checks: -C debug-assertions, -C
overflow-checks, and -Z force-overflow-checks.

Fixes rust-lang#33134.
@rust-highfive
Copy link
Collaborator

rust-highfive commented Feb 22, 2017

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@durka
Copy link
Contributor

durka commented Feb 22, 2017

  • insta-stable?
  • Does this option only allow turning on overflow checks (e.g., in release mode)? Should it instead be -C overflow-checks={on,off} so you could turn them off in debug mode?

@froydnj
Copy link
Contributor Author

froydnj commented Feb 22, 2017

insta-stable?

Sorry, I'm not sure what this means. Can you elaborate?

Should it instead be -C overflow-checks={on,off} so you could turn them off in debug mode?

The option specification permits -C overflow-checks={on,off}. Perhaps the commit message should be rewritten, or the documentation for the option, or both?

@durka
Copy link
Contributor

durka commented Feb 22, 2017

I mean does this need an unstable period? I'm not sure how that works with options. I guess this is kind of a stabilization of -Z force-overflow-checks, in which case, shouldn't that be removed?

@froydnj
Copy link
Contributor Author

froydnj commented Feb 22, 2017

I'm not sure how it works with options either! Discussions in #33134 suggested that -Z force-overflow-checks will be removed soonish after this lands, but I suspect waiting a release cycle or maybe even two would be recommended.

@alexcrichton alexcrichton added relnotes Marks issues that should be documented in the release notes of the next release. T-tools labels Feb 22, 2017
@alexcrichton
Copy link
Member

alexcrichton commented Feb 22, 2017

Looks great to me, thanks @froydnj! (additionally for the drive-by cleanup)

@durka this feature has already been unstable with -Z for quite some time now and has additionally gone through an RFC (albeit an old one), so we shouldn't need a stabilization period for this.

@bors: r+

@bors
Copy link
Contributor

bors commented Feb 22, 2017

📌 Commit ffc6ddd has been approved by alexcrichton

eddyb added a commit to eddyb/rust that referenced this pull request Feb 25, 2017
…hton

add `-C overflow-checks` option

In addition to defining and handling the new option, we also add a method on librustc::Session for determining the necessity of overflow checks.  This method provides a single point to sort out the three (!) different ways for turning on overflow checks: -C debug-assertions, -C overflow-checks, and -Z force-overflow-checks.

I was seeing a [run-pass/issue-28950.rs](https://github.com/rust-lang/rust/blob/b1363a73ede57ae595f3a1be2bb75d308ba4f7f6/src/test/run-pass/issue-28950.rs) failure on my machine with these patches, but I was also seeing the failure without the changes to the core compiler.  We'll see what travis says.

Fixes rust-lang#33134.  r? @alexcrichton
bors added a commit that referenced this pull request Feb 25, 2017
eddyb added a commit to eddyb/rust that referenced this pull request Feb 25, 2017
…hton

add `-C overflow-checks` option

In addition to defining and handling the new option, we also add a method on librustc::Session for determining the necessity of overflow checks.  This method provides a single point to sort out the three (!) different ways for turning on overflow checks: -C debug-assertions, -C overflow-checks, and -Z force-overflow-checks.

I was seeing a [run-pass/issue-28950.rs](https://github.com/rust-lang/rust/blob/b1363a73ede57ae595f3a1be2bb75d308ba4f7f6/src/test/run-pass/issue-28950.rs) failure on my machine with these patches, but I was also seeing the failure without the changes to the core compiler.  We'll see what travis says.

Fixes rust-lang#33134.  r? @alexcrichton
bors added a commit that referenced this pull request Feb 25, 2017
bors added a commit that referenced this pull request Feb 25, 2017
@bors bors merged commit ffc6ddd into rust-lang:master Feb 25, 2017
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.

None yet

5 participants