Fix overflow in rustc happening if the err_count() is reduced in a stage.#87761
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 6, 2021
Merged
Fix overflow in rustc happening if the err_count() is reduced in a stage.#87761bors merged 1 commit intorust-lang:masterfrom
err_count() is reduced in a stage.#87761bors merged 1 commit intorust-lang:masterfrom
Conversation
…stage. This can happen if stashed diagnostics are removed or replaced with fewer errors. The semantics stay the same if built without overflow. Fixes rust-lang#84219.
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
Member
|
Can you add a test for this somehow? |
Contributor
Author
I don't see a way without enabling overflow checks for the compiler. |
Member
|
@bors r+ I'm going to go ahead and approve this - I think in terms of testing we might want to try having a debug-assert builder also enable overflow checks. I'm not confident that this is the right behavior - it's likely more interesting changes are warranted - but for now this'll get us to parity with non overflow checks enabled compilers and the stashed diagnostics problem can be examined separately if needed. |
Collaborator
|
📌 Commit 5ff06fb has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 6, 2021
…_checks, r=Mark-Simulacrum
Add config.toml options for enabling overflow checks in rustc and std
The names are `overflow-checks` and `overflow-checks-std` and they work similar to `debug-assertions` and `debug-assertions-std`. Once added we can measure how big the performance impact actually is and maybe enable them for CI tests.
Enabling them already makes two ui tests fail:
```
failures:
[ui] ui/parser/item-free-const-no-body-semantic-fail.rs
[ui] ui/parser/item-free-static-no-body-semantic-fail.rs
```
(See rust-lang#84219 and rust-lang#87761.)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 6, 2021
Rollup of 7 pull requests Successful merges: - rust-lang#85807 (bootstrap: Disable initial-exec TLS model on powerpc) - rust-lang#87761 (Fix overflow in rustc happening if the `err_count()` is reduced in a stage.) - rust-lang#87775 (Add hint for unresolved associated trait items if the trait has a single item) - rust-lang#87779 (Remove special case for statement `NodeId` assignment) - rust-lang#87787 (Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort`) - rust-lang#87809 (Fix typo in the ptr documentation) - rust-lang#87816 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This can happen if stashed diagnostics are removed or replaced with fewer errors. The semantics stay the same if built without overflow checks. Fixes #84219.
Background: I came across this independently by running
RUSTFLAGS="-C overflow-checks=on" ./x.py test. Fixing this will allow us to move on and find further overflow errors with testing or fuzzing.