Skip to content

Commit

Permalink
Add missing upcast usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Dec 4, 2023
1 parent 731351b commit 6c3aa71
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions boa_engine/src/object/jsobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<VTableObject<dyn NativeObject>> = unsafe {
let ptr = Gc::into_raw(gc);
let ptr: NonNull<GcBox<VTableObject<dyn NativeObject>>> = 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.
Expand Down

0 comments on commit 6c3aa71

Please sign in to comment.