]> Repositorios git - scryer-prolog.git/commitdiff
remove unsafe `impl From<UntypedArenaPtr> for CodeIndex`
authorBennet Bleßmann <[email protected]>
Sun, 7 Jul 2024 12:18:50 +0000 (14:18 +0200)
committerBennet Bleßmann <[email protected]>
Sun, 7 Jul 2024 12:18:50 +0000 (14:18 +0200)
src/machine/heap.rs
src/machine/machine_indices.rs

index 7ba02da927dc366b6266fa6acfad658f6fa59e36..0f42b8c6812b3c32ed7c3c3983b833b78d8969f1 100644 (file)
@@ -69,8 +69,8 @@ impl TryFrom<HeapCellValue> for Literal {
                      (ArenaHeaderTag::Rational, n) => {
                          Ok(Literal::Rational(n))
                      }
-                     (ArenaHeaderTag::IndexPtr, _ip) => {
-                         Ok(Literal::CodeIndex(CodeIndex::from(cons_ptr)))
+                     (ArenaHeaderTag::IndexPtr, ip) => {
+                         Ok(Literal::CodeIndex(CodeIndex::from(ip)))
                      }
                      _ => {
                          Err(())
index cecdef22c4cf9a6cc3de175aae50dc45b7a88740..9dc8138ec4bcebd03454cbdb2504413b63849dab 100644 (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 {
     #[inline(always)]
     fn from(ptr: TypedArenaPtr<IndexPtr>) -> CodeIndex {