Skip to content

Commit

Permalink
Rollup merge of rust-lang#89828 - rusticstuff:overflow-check-options-…
Browse files Browse the repository at this point in the history
…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``
  • Loading branch information
the8472 authored Oct 13, 2021
2 parents 67f3a5f + 905ed5f commit c913af6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,18 @@ changelog-seen = 2
# set this value to `true`.
#debug-logging = rust.debug-assertions (boolean)

# Whether or not overflow checks are enabled for the compiler and standard
# library.
#
# Defaults to rust.debug value
#overflow-checks = rust.debug (boolean)

# Whether or not overflow checks are enabled for the standard library.
# Overrides the `overflow-checks` option, if defined.
#
# Defaults to rust.overflow-checks value
#overflow-checks-std = rust.overflow-checks (boolean)

# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
# `0` - no debug info
# `1` - line tables only - sufficient to generate backtraces that include line
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,8 @@ impl Config {
config.rust_debug_assertions_std =
debug_assertions_std.unwrap_or(config.rust_debug_assertions);
config.rust_overflow_checks = overflow_checks.unwrap_or(default);
config.rust_overflow_checks_std = overflow_checks_std.unwrap_or(default);
config.rust_overflow_checks_std =
overflow_checks_std.unwrap_or(config.rust_overflow_checks);

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

Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def v(*args):
o("llvm-assertions", "llvm.assertions", "build LLVM with assertions")
o("llvm-plugins", "llvm.plugins", "build LLVM with plugin interface")
o("debug-assertions", "rust.debug-assertions", "build with debugging assertions")
o("debug-assertions-std", "rust.debug-assertions-std", "build the standard library with debugging assertions")
o("overflow-checks", "rust.overflow-checks", "build with overflow checks")
o("overflow-checks-std", "rust.overflow-checks-std", "build the standard library with overflow checks")
o("llvm-release-debuginfo", "llvm.release-debuginfo", "build LLVM with debugger metadata")
v("debuginfo-level", "rust.debuginfo-level", "debuginfo level for Rust code")
v("debuginfo-level-rustc", "rust.debuginfo-level-rustc", "debuginfo level for the compiler")
Expand Down

0 comments on commit c913af6

Please sign in to comment.