diff --git a/src/rust.rs b/src/rust.rs index 250c9533a..ad68f6597 100644 --- a/src/rust.rs +++ b/src/rust.rs @@ -1477,7 +1477,7 @@ impl<'a> CapturedJSStack<'a> { pub fn as_string(&self, indent: Option) -> Option { unsafe { let stack_handle = self.stack.handle(); - rooted!(in(self.cx) let mut js_string = ptr::null_mut()); + rooted!(in(self.cx) let mut js_string = ptr::null_mut::()); let string_handle = js_string.handle_mut(); if !IsSavedFrame(stack_handle.get()) { diff --git a/tests/typedarray.rs b/tests/typedarray.rs index 6bfbb63c2..172cea4e0 100644 --- a/tests/typedarray.rs +++ b/tests/typedarray.rs @@ -11,6 +11,7 @@ use mozjs::jsapi::JS_NewGlobalObject; use mozjs::jsapi::OnNewGlobalHookOption; use mozjs::jsapi::Type; use mozjs::jsval::UndefinedValue; +use mozjs::jsapi::JSObject; use mozjs::rust::Runtime as Runtime_; use mozjs::rust::SIMPLE_GLOBAL_CLASS; use mozjs::typedarray::{CreateWith, Uint32Array}; @@ -44,7 +45,7 @@ fn typedarray() { typedarray!(in(cx) let view: ArrayBufferView = rval.to_object()); assert_eq!(view.unwrap().get_array_type(), Type::Uint8); - rooted!(in(cx) let mut rval = ptr::null_mut()); + rooted!(in(cx) let mut rval = ptr::null_mut::()); assert!(Uint32Array::create(cx, CreateWith::Slice(&[1, 3, 5]), rval.handle_mut()).is_ok()); typedarray!(in(cx) let array: Uint32Array = rval.get()); @@ -54,11 +55,11 @@ fn typedarray() { array.as_mut().unwrap().update(&[2, 4, 6]); assert_eq!(array.unwrap().as_slice(), &[2, 4, 6][..]); - rooted!(in(cx) let rval = ptr::null_mut()); + rooted!(in(cx) let rval = ptr::null_mut::()); typedarray!(in(cx) let array: Uint8Array = rval.get()); assert!(array.is_err()); - rooted!(in(cx) let mut rval = ptr::null_mut()); + rooted!(in(cx) let mut rval = ptr::null_mut::()); assert!(Uint32Array::create(cx, CreateWith::Length(5), rval.handle_mut()).is_ok()); typedarray!(in(cx) let array: Uint32Array = rval.get()); @@ -87,7 +88,7 @@ fn typedarray_update_panic() { ); let _ac = JSAutoCompartment::new(cx, global.get()); - rooted!(in(cx) let mut rval = ptr::null_mut()); + rooted!(in(cx) let mut rval = ptr::null_mut::()); let _ = Uint32Array::create(cx, CreateWith::Slice(&[1, 2, 3, 4, 5]), rval.handle_mut()); typedarray!(in(cx) let mut array: Uint32Array = rval.get()); array.as_mut().unwrap().update(&[0, 2, 4, 6, 8, 10]);