Bug 1416490 - Check for a value passed to RUSTC_OPT_LEVEL rather than whether its value was a default.
The current code will fail if "RUSTC_OPT_LEVEL=" is passed. This can happen
if the value isn't present and that fact is injected into js' configure. We
only want to respect RUSTC_OPT_LEVEL if a value is passed, so we simply check
for the presence of a value rather than its origin.
MozReview-Commit-ID: 6GhLfprJEEn
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1346,17 +1346,17 @@ def rust_compiler_flags(opt_level_option
# Code here derives various compiler options given other configure options.
# The options defined here effectively override defaults specified in
# Cargo.toml files.
opt_level = None
debug_assertions = None
debug_info = None
- if opt_level_option.origin != 'default':
+ if opt_level_option:
opt_level = opt_level_option[0]
else:
opt_level = '1' if optimize else '0'
# opt-level=0 implies -C debug-assertions, which may not be desired
# unless Rust debugging is enabled.
if opt_level == '0' and not debug_rust:
debug_assertions = False