Bug 1335203 - Synchronize rust debug-assertions with C++ DEBUG, r=froydnj

MozReview-Commit-ID: JPD9eNFg89S
This commit is contained in:
Michael Layzell 2017-02-01 13:30:01 -05:00
Родитель b62bca9af3
Коммит 0dadca05f7
2 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -940,7 +940,13 @@ endif
# optimization level here, if necessary. (The Cargo.toml files already
# specify debug-assertions appropriately for --{disable,enable}-debug.)
ifndef MOZ_OPTIMIZE
rustflags_override = RUSTFLAGS='-C opt-level=0'
rustflags = -C opt-level=0
# Unfortunately, -C opt-level=0 implies -C debug-assertions, so we need
# to explicitly disable them when MOZ_DEBUG is not set.
ifndef MOZ_DEBUG
rustflags += -C debug-assertions=no
endif
rustflags_override = RUSTFLAGS='$(rustflags)'
endif
CARGO_BUILD = env $(rustflags_override) \

Просмотреть файл

@ -355,12 +355,14 @@ static_assert(sizeof(nsStringContainer_base) == sizeof(nsSubstring),
// Provide rust bindings to the nsA[C]String types
extern "C" {
// This is a no-op on release, when bug 1335203 is fixed we should ifdef this
// to ensure using it in release results in a linker error.
// This is a no-op on release, so we ifdef it out such that using it in release
// results in a linker error.
#ifdef DEBUG
void Gecko_IncrementStringAdoptCount(void* aData)
{
MOZ_LOG_CTOR(aData, "StringAdopt", 1);
}
#endif
void Gecko_FinalizeCString(nsACString* aThis)
{