Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.

Commit 1f5818d

Browse files
author
bors-servo
authored
Auto merge of #307 - servo:36247, r=jdm
Wrap uses of extern statics in unsafe blocks. This fixes safe_extern_statics warnings; see <rust-lang/rust#36247>. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/307) <!-- Reviewable:end -->
2 parents 4f25903 + eb65ff7 commit 1f5818d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/rust.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,15 @@ impl<T> DerefMut for MutableHandle<T> {
440440

441441
impl HandleValue {
442442
pub fn null() -> HandleValue {
443-
NullHandleValue
443+
unsafe {
444+
NullHandleValue
445+
}
444446
}
445447

446448
pub fn undefined() -> HandleValue {
447-
UndefinedHandleValue
449+
unsafe {
450+
UndefinedHandleValue
451+
}
448452
}
449453
}
450454

@@ -459,7 +463,11 @@ impl HandleObject {
459463
}
460464

461465
impl Default for jsid {
462-
fn default() -> jsid { JSID_VOID }
466+
fn default() -> jsid {
467+
unsafe {
468+
JSID_VOID
469+
}
470+
}
463471
}
464472

465473
impl Default for Value {

0 commit comments

Comments
 (0)