Skip to content

add -C overflow-checks option - #40037

Merged
bors merged 1 commit into
rust-lang:masterfrom
froydnj:overflow-checks
Feb 25, 2017
Merged

add -C overflow-checks option#40037
bors merged 1 commit into
rust-lang:masterfrom
froydnj:overflow-checks

Conversation

@froydnj

Copy link
Copy Markdown
Contributor

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.
Fixesrust-lang#33134.
@rust-highfive

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor
  • 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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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.

@alexcrichtonalexcrichton 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
Copy Markdown
Member

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

bors commented Feb 22, 2017

Copy link
Copy Markdown
Collaborator

📌 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.
Fixesrust-lang#33134. r? @alexcrichton
@eddybeddyb mentioned 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.
Fixesrust-lang#33134. r? @alexcrichton
@eddybeddyb mentioned 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:masterFeb 25, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotesMarks 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.

5 participants

@froydnj@rust-highfive@durka@alexcrichton@bors