diff --git a/components/script_bindings/root.rs b/components/script_bindings/root.rs index 3d0378f0df1..f383447a997 100644 --- a/components/script_bindings/root.rs +++ b/components/script_bindings/root.rs @@ -229,15 +229,15 @@ impl Deref for Dom { } unsafe impl JSTraceable for Dom { - unsafe fn trace(&self, trc: *mut JSTracer) { - let trace_string; + unsafe fn trace(&self, tracer: *mut JSTracer) { let trace_info = if cfg!(debug_assertions) { - trace_string = format!("for {} on heap", ::std::any::type_name::()); - &trace_string[..] + std::any::type_name::() } else { - "for DOM object on heap" + "DOM object on heap" }; - trace_reflector(trc, trace_info, (*self.ptr.as_ptr()).reflector()); + unsafe { + trace_reflector(tracer, trace_info, (*self.ptr.as_ptr()).reflector()); + } } }