diff options
| author | Rubens Brandao <git@rubens.io> | 2024-04-16 17:03:20 -0300 |
|---|---|---|
| committer | Rubens Brandao <git@rubens.io> | 2024-04-16 17:03:20 -0300 |
| commit | f3c1a3cb3cbdd25d5f556d1ab770f8cbc29fd567 (patch) | |
| tree | 71a6f2e8df93f7ef08bda08caca3a637588cc919 /rust/src/relocation.rs | |
| parent | 37b51462dcf26dc40ac5d7e82acdfd4cbe754157 (diff) | |
add guard to array with unbound return types
Diffstat (limited to 'rust/src/relocation.rs')
| -rw-r--r-- | rust/src/relocation.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/rust/src/relocation.rs b/rust/src/relocation.rs index 47ec2ac0..455f5a5a 100644 --- a/rust/src/relocation.rs +++ b/rust/src/relocation.rs @@ -1,3 +1,4 @@ +use crate::rc::Guard; use crate::string::BnStrCompatible; use crate::{ architecture::{Architecture, CoreArchitecture}, @@ -228,11 +229,9 @@ unsafe impl CoreOwnedArrayProvider for Relocation { } unsafe impl CoreArrayWrapper for Relocation { - // TODO there is nothing blocking the returned value from out-living the - // array, change it to &_ or Guard? - type Wrapped<'a> = Relocation; + type Wrapped<'a> = Guard<'a, Relocation>; unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { - Relocation(*raw) + Guard::new(Relocation(*raw), &()) } } |
