From 6c3aa71ed295e7939dc5fb96e488925c6a065157 Mon Sep 17 00:00:00 2001 From: jedel1043 Date: Mon, 4 Dec 2023 02:06:13 -0600 Subject: [PATCH] Add missing upcast usage --- boa_engine/src/object/jsobject.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/boa_engine/src/object/jsobject.rs b/boa_engine/src/object/jsobject.rs index d9decf22abe..04a7ec3bc7f 100644 --- a/boa_engine/src/object/jsobject.rs +++ b/boa_engine/src/object/jsobject.rs @@ -77,15 +77,7 @@ impl JsObject { vtable, }); - // SAFETY: This just makes the casting from sized to unsized. Should eventually be replaced by - // https://github.com/rust-lang/rust/issues/18598 - let gc: Gc> = unsafe { - let ptr = Gc::into_raw(gc); - let ptr: NonNull>> = ptr; - Gc::from_raw(ptr) - }; - - Self { inner: gc } + Self { inner: upcast(gc) } } /// Creates a new ordinary object with its prototype set to the `Object` prototype.