remove unsafe impl From<UntypedArenaPtr> for CodeIndex

This commit is contained in:
Bennet Bleßmann
2024-07-07 14:18:50 +02:00
parent 39bd520542
commit 74720d4d2e
2 changed files with 2 additions and 9 deletions

View File

@@ -69,8 +69,8 @@ impl TryFrom<HeapCellValue> for Literal {
(ArenaHeaderTag::Rational, n) => { (ArenaHeaderTag::Rational, n) => {
Ok(Literal::Rational(n)) Ok(Literal::Rational(n))
} }
(ArenaHeaderTag::IndexPtr, _ip) => { (ArenaHeaderTag::IndexPtr, ip) => {
Ok(Literal::CodeIndex(CodeIndex::from(cons_ptr))) Ok(Literal::CodeIndex(CodeIndex::from(ip)))
} }
_ => { _ => {
Err(()) Err(())

View File

@@ -159,13 +159,6 @@ impl From<CodeIndex> for UntypedArenaPtr {
} }
} }
impl From<UntypedArenaPtr> for CodeIndex {
#[inline(always)]
fn from(ptr: UntypedArenaPtr) -> CodeIndex {
CodeIndex(unsafe { ptr.as_typed_ptr() })
}
}
impl From<TypedArenaPtr<IndexPtr>> for CodeIndex { impl From<TypedArenaPtr<IndexPtr>> for CodeIndex {
#[inline(always)] #[inline(always)]
fn from(ptr: TypedArenaPtr<IndexPtr>) -> CodeIndex { fn from(ptr: TypedArenaPtr<IndexPtr>) -> CodeIndex {