Provide separate option for std debug asserts
This commit is contained in:
parent
d903a9def4
commit
6c415450fd
3 changed files with 18 additions and 1 deletions
|
@ -314,6 +314,10 @@
|
|||
# library.
|
||||
#debug-assertions = false
|
||||
|
||||
# Whether or not debug assertions are enabled for the standard library.
|
||||
# Overrides the `debug-assertions` option, if defined.
|
||||
#debug-assertions-std = false
|
||||
|
||||
# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
|
||||
# `0` - no debug info
|
||||
# `1` - line tables only
|
||||
|
|
|
@ -916,7 +916,14 @@ impl<'a> Builder<'a> {
|
|||
.env("RUSTC", self.out.join("bootstrap/debug/rustc"))
|
||||
.env("RUSTC_REAL", self.rustc(compiler))
|
||||
.env("RUSTC_STAGE", stage.to_string())
|
||||
.env("RUSTC_DEBUG_ASSERTIONS", self.config.rust_debug_assertions.to_string())
|
||||
.env(
|
||||
"RUSTC_DEBUG_ASSERTIONS",
|
||||
if mode == Mode::Std {
|
||||
self.config.rust_debug_assertions_std.to_string()
|
||||
} else {
|
||||
self.config.rust_debug_assertions.to_string()
|
||||
},
|
||||
)
|
||||
.env("RUSTC_SYSROOT", &sysroot)
|
||||
.env("RUSTC_LIBDIR", &libdir)
|
||||
.env("RUSTDOC", self.out.join("bootstrap/debug/rustdoc"))
|
||||
|
|
|
@ -98,6 +98,7 @@ pub struct Config {
|
|||
pub rust_codegen_units: Option<u32>,
|
||||
pub rust_codegen_units_std: Option<u32>,
|
||||
pub rust_debug_assertions: bool,
|
||||
pub rust_debug_assertions_std: bool,
|
||||
pub rust_debuginfo_level_rustc: u32,
|
||||
pub rust_debuginfo_level_std: u32,
|
||||
pub rust_debuginfo_level_tools: u32,
|
||||
|
@ -315,6 +316,7 @@ struct Rust {
|
|||
codegen_units: Option<u32>,
|
||||
codegen_units_std: Option<u32>,
|
||||
debug_assertions: Option<bool>,
|
||||
debug_assertions_std: Option<bool>,
|
||||
debuginfo_level: Option<u32>,
|
||||
debuginfo_level_rustc: Option<u32>,
|
||||
debuginfo_level_std: Option<u32>,
|
||||
|
@ -520,6 +522,7 @@ impl Config {
|
|||
let mut llvm_assertions = None;
|
||||
let mut debug = None;
|
||||
let mut debug_assertions = None;
|
||||
let mut debug_assertions_std = None;
|
||||
let mut debuginfo_level = None;
|
||||
let mut debuginfo_level_rustc = None;
|
||||
let mut debuginfo_level_std = None;
|
||||
|
@ -562,6 +565,7 @@ impl Config {
|
|||
if let Some(ref rust) = toml.rust {
|
||||
debug = rust.debug;
|
||||
debug_assertions = rust.debug_assertions;
|
||||
debug_assertions_std = rust.debug_assertions_std;
|
||||
debuginfo_level = rust.debuginfo_level;
|
||||
debuginfo_level_rustc = rust.debuginfo_level_rustc;
|
||||
debuginfo_level_std = rust.debuginfo_level_std;
|
||||
|
@ -661,6 +665,8 @@ impl Config {
|
|||
|
||||
let default = debug == Some(true);
|
||||
config.rust_debug_assertions = debug_assertions.unwrap_or(default);
|
||||
config.rust_debug_assertions_std =
|
||||
debug_assertions_std.unwrap_or(config.rust_debug_assertions);
|
||||
|
||||
let with_defaults = |debuginfo_level_specific: Option<u32>| {
|
||||
debuginfo_level_specific.or(debuginfo_level).unwrap_or(if debug == Some(true) {
|
||||
|
|
Loading…
Add table
Reference in a new issue