-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix overflow in rustc happening if the err_count()
is reduced in a stage.
#87761
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.
(rust-highfive has picked a reviewer for you, use r? to override) |
Can you add a test for this somehow? |
I don't see a way without enabling overflow checks for the compiler. |
@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. |
📌 Commit 5ff06fb has been approved by |
…_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.)
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 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.