From 2f36905a5efe9e57fe70bcf4e63c9436e25837ce Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Thu, 10 Oct 2024 07:45:03 -0700 Subject: [PATCH] Remove the now-unused `VMGcRef::as_externref_unchecked` method --- .../wasmtime/src/runtime/vm/gc/enabled/externref.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/crates/wasmtime/src/runtime/vm/gc/enabled/externref.rs b/crates/wasmtime/src/runtime/vm/gc/enabled/externref.rs index 01dcaadab54..e0b684e3666 100644 --- a/crates/wasmtime/src/runtime/vm/gc/enabled/externref.rs +++ b/crates/wasmtime/src/runtime/vm/gc/enabled/externref.rs @@ -71,19 +71,6 @@ impl VMGcRef { None } } - - /// Get this GC reference as an `externref` reference without checking if it - /// actually is an `externref` reference. - /// - /// Calling this method on a non-`externref` reference is memory safe, but - /// will lead to general incorrectness like panics and wrong results. - pub fn as_externref_unchecked(&self) -> &VMExternRef { - debug_assert!(!self.is_i31()); - let ptr = self as *const VMGcRef; - let ret = unsafe { &*ptr.cast() }; - assert!(matches!(ret, VMExternRef(VMGcRef { .. }))); - ret - } } impl VMExternRef {