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

Commit eb65ff7

Browse files
committed
Wrap uses of extern statics in unsafe blocks.
This fixes safe_extern_statics warnings; see <rust-lang/rust#36247>.
1 parent 4f25903 commit eb65ff7

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)