From 37b51462dcf26dc40ac5d7e82acdfd4cbe754157 Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Wed, 10 Apr 2024 17:58:05 -0300 Subject: fix the array implementation using GAT --- rust/src/references.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'rust/src/references.rs') diff --git a/rust/src/references.rs b/rust/src/references.rs index 76ac4493..a30f3f5e 100644 --- a/rust/src/references.rs +++ b/rust/src/references.rs @@ -64,10 +64,12 @@ unsafe impl CoreOwnedArrayProvider for CodeReference { } } -unsafe impl<'a> CoreArrayWrapper<'a> for CodeReference { - type Wrapped = CodeReference; +unsafe impl CoreArrayWrapper for CodeReference { + // TODO there is nothing blocking the returned value from out-living the + // array, change it to Guard? + type Wrapped<'a> = CodeReference; - unsafe fn wrap_raw(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped { + unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { CodeReference::new(raw) } } @@ -85,10 +87,10 @@ unsafe impl CoreOwnedArrayProvider for DataReference { } } -unsafe impl<'a> CoreArrayWrapper<'a> for DataReference { - type Wrapped = DataReference; +unsafe impl CoreArrayWrapper for DataReference { + type Wrapped<'a> = DataReference; - unsafe fn wrap_raw(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped { + unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { DataReference { address: *raw } } } -- cgit v1.3.1