Skip to content

Remove -Z force-overflow-checks #91185

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

Merged
merged 1 commit into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ fn test_debugging_options_tracking_hash() {
tracked!(dep_info_omit_d_target, true);
tracked!(dual_proc_macros, true);
tracked!(fewer_names, Some(true));
tracked!(force_overflow_checks, Some(true));
tracked!(force_unstable_if_unmarked, true);
tracked!(fuel, Some(("abc".to_string(), 99)));
tracked!(function_sections, Some(false));
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,8 +1131,6 @@ options! {
fewer_names: Option<bool> = (None, parse_opt_bool, [TRACKED],
"reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR) \
(default: no)"),
force_overflow_checks: Option<bool> = (None, parse_opt_bool, [TRACKED],
"force overflow checks on or off"),
force_unstable_if_unmarked: bool = (false, parse_bool, [TRACKED],
"force all crates to be `rustc_private` unstable (default: no)"),
fuel: Option<(String, u64)> = (None, parse_optimization_fuel, [TRACKED],
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,11 +678,7 @@ impl Session {
self.opts.debugging_opts.sanitizer.contains(SanitizerSet::CFI)
}
pub fn overflow_checks(&self) -> bool {
self.opts
.cg
.overflow_checks
.or(self.opts.debugging_opts.force_overflow_checks)
.unwrap_or(self.opts.debug_assertions)
self.opts.cg.overflow_checks.unwrap_or(self.opts.debug_assertions)
}

/// Check whether this compile session and crate type use static crt.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-err.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// build-fail
// compile-flags: -Zforce-overflow-checks=on
// compile-flags: -C overflow-checks=on

#![allow(arithmetic_overflow)]
#![warn(const_err)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir_overflow_off.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags: -Z force-overflow-checks=off
// compile-flags: -C overflow-checks=off

// Test that with MIR codegen, overflow checks can be
// turned off, even when they're from core::ops::*.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/numbers-arithmetic/int-abs-overflow.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags: -Z force-overflow-checks=on
// compile-flags: -C overflow-checks=on
// ignore-emscripten no threads support

use std::thread;
Expand Down