diff options
author | Karol Herbst <git@karolherbst.de> | 2023-07-08 18:53:38 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-07-12 15:18:22 +0000 |
commit | 2c48ce81a82436d2aff3e0d6b9169d83e33038bf (patch) | |
tree | f34db7d6401e9bdef77631995c6b2e60a1bf47de | |
parent | d653eb8a9a06af1c9e9001698def1bb09ab4a87c (diff) |
api/icd: drop static lifetime from `get_ref` return type23.2.0-branchpoint
This was never correct as the object pointed to can be destroyed at any
moment.
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24061>
-rw-r--r-- | src/gallium/frontends/rusticl/api/icd.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/frontends/rusticl/api/icd.rs b/src/gallium/frontends/rusticl/api/icd.rs index a72a9fcf217..a0ede4cb640 100644 --- a/src/gallium/frontends/rusticl/api/icd.rs +++ b/src/gallium/frontends/rusticl/api/icd.rs @@ -231,7 +231,7 @@ pub trait ReferenceCountedAPIPointer<T, const ERR: i32> { } } - fn get_ref(&self) -> CLResult<&'static T> { + fn get_ref(&self) -> CLResult<&T> { unsafe { Ok(self.get_ptr()?.as_ref().unwrap()) } } @@ -272,9 +272,9 @@ pub trait ReferenceCountedAPIPointer<T, const ERR: i32> { Ok(res) } - fn get_ref_vec_from_arr(objs: *const Self, count: u32) -> CLResult<Vec<&'static T>> + fn get_ref_vec_from_arr<'a>(objs: *const Self, count: u32) -> CLResult<Vec<&'a T>> where - Self: Sized, + Self: Sized + 'a, { // CL spec requires validation for obj arrays, both values have to make sense if objs.is_null() && count > 0 || !objs.is_null() && count == 0 { |