From 943d94de7f15d042a83d2e2de5d5e8238aa1e121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 23 Mar 2018 02:15:55 +0100 Subject: [PATCH] Bug 1448201: Fix SpiderMonkey Rust breakage. r=jdm Was broken by bug 888600, which converted JSID_VOID into a constexpr and thus made it not appear at build time. This should make this faster as well... MozReview-Commit-ID: 34eQhr5H5Ks --- js/rust/build.rs | 2 +- js/rust/src/rust.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/rust/build.rs b/js/rust/build.rs index 59d53dc83520..a685afb1e2b2 100644 --- a/js/rust/build.rs +++ b/js/rust/build.rs @@ -245,7 +245,7 @@ const WHITELIST_VARS: &'static [&'static str] = &[ "JS_STRUCTURED_CLONE_VERSION", "JSCLASS_.*", "JSFUN_.*", - "JSID_VOID", + "JSID_TYPE_VOID", "JSITER_.*", "JSPROP_.*", "JS::FalseHandleValue", diff --git a/js/rust/src/rust.rs b/js/rust/src/rust.rs index d7beffe84dcc..21793fc41677 100644 --- a/js/rust/src/rust.rs +++ b/js/rust/src/rust.rs @@ -541,8 +541,8 @@ impl JS::HandleObject { impl Default for jsid { fn default() -> jsid { - unsafe { - JSID_VOID + jsid { + asBits: JSID_TYPE_VOID as usize, } } } @@ -567,7 +567,7 @@ pub trait GCMethods { } impl GCMethods for jsid { - unsafe fn initial() -> jsid { JSID_VOID } + unsafe fn initial() -> jsid { Default::default() } unsafe fn post_barrier(_: *mut jsid, _: jsid, _: jsid) {} }