Skip to content

Commit 984e644

Browse files
authored
Rollup merge of #91185 - camelid:rm-force-overflow-checks, r=wesleywiser
Remove `-Z force-overflow-checks` It was replaced several years ago by the stable option `-C overflow-checks`. The goal was to delete the `-Z` flag once users had migrated [1]. Now that it's been several years, it makes sense to delete the old flag. See also the discussion on Zulip [2]. [1]: #33134 (comment) [2]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/overflow.20checks/near/262497224 r? ```@wesleywiser``` cc ```@RalfJung```
2 parents 5fff1d7 + f0b990a commit 984e644

File tree

6 files changed

+4
-11
lines changed

6 files changed

+4
-11
lines changed

compiler/rustc_interface/src/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ fn test_debugging_options_tracking_hash() {
726726
tracked!(dep_info_omit_d_target, true);
727727
tracked!(dual_proc_macros, true);
728728
tracked!(fewer_names, Some(true));
729-
tracked!(force_overflow_checks, Some(true));
730729
tracked!(force_unstable_if_unmarked, true);
731730
tracked!(fuel, Some(("abc".to_string(), 99)));
732731
tracked!(function_sections, Some(false));

compiler/rustc_session/src/options.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,6 @@ options! {
11311131
fewer_names: Option<bool> = (None, parse_opt_bool, [TRACKED],
11321132
"reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR) \
11331133
(default: no)"),
1134-
force_overflow_checks: Option<bool> = (None, parse_opt_bool, [TRACKED],
1135-
"force overflow checks on or off"),
11361134
force_unstable_if_unmarked: bool = (false, parse_bool, [TRACKED],
11371135
"force all crates to be `rustc_private` unstable (default: no)"),
11381136
fuel: Option<(String, u64)> = (None, parse_optimization_fuel, [TRACKED],

compiler/rustc_session/src/session.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -678,11 +678,7 @@ impl Session {
678678
self.opts.debugging_opts.sanitizer.contains(SanitizerSet::CFI)
679679
}
680680
pub fn overflow_checks(&self) -> bool {
681-
self.opts
682-
.cg
683-
.overflow_checks
684-
.or(self.opts.debugging_opts.force_overflow_checks)
685-
.unwrap_or(self.opts.debug_assertions)
681+
self.opts.cg.overflow_checks.unwrap_or(self.opts.debug_assertions)
686682
}
687683

688684
/// Check whether this compile session and crate type use static crt.

src/test/ui/consts/const-err.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// build-fail
2-
// compile-flags: -Zforce-overflow-checks=on
2+
// compile-flags: -C overflow-checks=on
33

44
#![allow(arithmetic_overflow)]
55
#![warn(const_err)]

src/test/ui/mir/mir_overflow_off.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-pass
2-
// compile-flags: -Z force-overflow-checks=off
2+
// compile-flags: -C overflow-checks=off
33

44
// Test that with MIR codegen, overflow checks can be
55
// turned off, even when they're from core::ops::*.

src/test/ui/numbers-arithmetic/int-abs-overflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-pass
2-
// compile-flags: -Z force-overflow-checks=on
2+
// compile-flags: -C overflow-checks=on
33
// ignore-emscripten no threads support
44

55
use std::thread;

0 commit comments

Comments
 (0)