Skip to content

Commit 5b2deeb

Browse files
authored
Rollup merge of rust-lang#89828 - rusticstuff:overflow-check-options-take-two, r=Mark-Simulacrum
Fix config.toml overflow-checks options This a follow-up PR to rust-lang#87784. Improvements: * Add missing entries for overflow-checks to config.toml.example. * Add --enable-overflow-checks-std option to configure script. * Make rust.overflow-checks-stdoption default to rust.overflow-checks. Also adds the missing `--enable-debug-assertions-std `option to configure script. r? `@Mark-Simulacrum` cc `@jyn514`
2 parents b14d2bf + 905ed5f commit 5b2deeb

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

config.toml.example

+12
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,18 @@ changelog-seen = 2
423423
# set this value to `true`.
424424
#debug-logging = rust.debug-assertions (boolean)
425425

426+
# Whether or not overflow checks are enabled for the compiler and standard
427+
# library.
428+
#
429+
# Defaults to rust.debug value
430+
#overflow-checks = rust.debug (boolean)
431+
432+
# Whether or not overflow checks are enabled for the standard library.
433+
# Overrides the `overflow-checks` option, if defined.
434+
#
435+
# Defaults to rust.overflow-checks value
436+
#overflow-checks-std = rust.overflow-checks (boolean)
437+
426438
# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
427439
# `0` - no debug info
428440
# `1` - line tables only - sufficient to generate backtraces that include line

src/bootstrap/config.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,8 @@ impl Config {
982982
config.rust_debug_assertions_std =
983983
debug_assertions_std.unwrap_or(config.rust_debug_assertions);
984984
config.rust_overflow_checks = overflow_checks.unwrap_or(default);
985-
config.rust_overflow_checks_std = overflow_checks_std.unwrap_or(default);
985+
config.rust_overflow_checks_std =
986+
overflow_checks_std.unwrap_or(config.rust_overflow_checks);
986987

987988
config.rust_debug_logging = debug_logging.unwrap_or(config.rust_debug_assertions);
988989

src/bootstrap/configure.py

+2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def v(*args):
7575
o("llvm-assertions", "llvm.assertions", "build LLVM with assertions")
7676
o("llvm-plugins", "llvm.plugins", "build LLVM with plugin interface")
7777
o("debug-assertions", "rust.debug-assertions", "build with debugging assertions")
78+
o("debug-assertions-std", "rust.debug-assertions-std", "build the standard library with debugging assertions")
7879
o("overflow-checks", "rust.overflow-checks", "build with overflow checks")
80+
o("overflow-checks-std", "rust.overflow-checks-std", "build the standard library with overflow checks")
7981
o("llvm-release-debuginfo", "llvm.release-debuginfo", "build LLVM with debugger metadata")
8082
v("debuginfo-level", "rust.debuginfo-level", "debuginfo level for Rust code")
8183
v("debuginfo-level-rustc", "rust.debuginfo-level-rustc", "debuginfo level for the compiler")

0 commit comments

Comments
 (0)