rusticl: Fix hidden lifetime warnings
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Fix the following warning, and others that are similar, as rustc
suggests:

warning: hiding a lifetime that's elided elsewhere is confusing
   --> ../src/gallium/frontends/rusticl/mesa/compiler/nir.rs:282:22
    |
282 |     pub fn variables(&mut self) -> ExecListIter<nir_variable> {
    |                      ^^^^^^^^^     -------------------------- the same lifetime is hidden here
    |                      |
    |                      the lifetime is elided here
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
282 |     pub fn variables(&mut self) -> ExecListIter<'_, nir_variable> {
    |                                                 +++

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37059>
This commit is contained in:
Philipp Zabel 2025-08-28 16:20:34 +02:00 committed by Marge Bot
parent 26c1ded905
commit 0e6b24451d
10 changed files with 20 additions and 20 deletions

View file

@ -132,7 +132,7 @@ pub trait HelperContextWrapper {
offset: i32,
size: i32,
rw: RWFlags,
) -> Option<PipeTransfer>;
) -> Option<PipeTransfer<'_>>;
fn create_compute_state(&self, nir: &NirShader, static_local_mem: u32) -> *mut c_void;
fn delete_compute_state(&self, cso: *mut c_void);
fn compute_state_info(&self, state: *mut c_void) -> pipe_compute_state_object_info;
@ -144,14 +144,14 @@ pub trait HelperContextWrapper {
offset: i32,
size: i32,
rw: RWFlags,
) -> Option<PipeTransfer>;
) -> Option<PipeTransfer<'_>>;
fn map_texture_unsynchronized(
&self,
res: &PipeResource,
bx: &pipe_box,
rw: RWFlags,
) -> Option<PipeTransfer>;
) -> Option<PipeTransfer<'_>>;
fn is_create_fence_fd_supported(&self) -> bool;
fn import_fence(&self, fence_fd: &FenceFd, fence_type: pipe_fd_type) -> CLResult<PipeFence>;
@ -200,7 +200,7 @@ impl HelperContextWrapper for HelperContext<'_> {
offset: i32,
size: i32,
rw: RWFlags,
) -> Option<PipeTransfer> {
) -> Option<PipeTransfer<'_>> {
self.lock.buffer_map(res, offset, size, rw)
}
@ -226,7 +226,7 @@ impl HelperContextWrapper for HelperContext<'_> {
offset: i32,
size: i32,
rw: RWFlags,
) -> Option<PipeTransfer> {
) -> Option<PipeTransfer<'_>> {
self.lock.buffer_map_flags(
res,
offset,
@ -240,7 +240,7 @@ impl HelperContextWrapper for HelperContext<'_> {
res: &PipeResource,
bx: &pipe_box,
rw: RWFlags,
) -> Option<PipeTransfer> {
) -> Option<PipeTransfer<'_>> {
self.lock
.texture_map_flags(res, bx, pipe_map_flags::PIPE_MAP_UNSYNCHRONIZED | rw.into())
}
@ -1122,7 +1122,7 @@ impl DeviceBase {
})
}
fn reusable_ctx(&self) -> MutexGuard<Vec<PipeContext>> {
fn reusable_ctx(&self) -> MutexGuard<'_, Vec<PipeContext>> {
self.reusable_ctx.lock().unwrap()
}

View file

@ -97,7 +97,7 @@ impl Event {
})
}
fn state(&self) -> MutexGuard<EventMutState> {
fn state(&self) -> MutexGuard<'_, EventMutState> {
self.state.lock().unwrap()
}

View file

@ -1721,7 +1721,7 @@ impl Kernel {
}))
}
pub fn arg_values(&self) -> MutexGuard<Vec<Option<KernelArgValue>>> {
pub fn arg_values(&self) -> MutexGuard<'_, Vec<Option<KernelArgValue>>> {
self.values.lock().unwrap()
}

View file

@ -474,7 +474,7 @@ impl Program {
})
}
pub fn build_info(&self) -> MutexGuard<ProgramBuild> {
pub fn build_info(&self) -> MutexGuard<'_, ProgramBuild> {
self.build.lock().unwrap()
}

View file

@ -234,7 +234,7 @@ impl SendableQueueContext {
}
/// The returned value can be used to execute operation on the wrapped context in a safe manner.
fn ctx(&self) -> QueueContext {
fn ctx(&self) -> QueueContext<'_> {
QueueContext {
ctx: &self.ctx,
dev: self.dev,

View file

@ -279,7 +279,7 @@ impl NirShader {
unsafe { nir_cleanup_functions(self.nir.as_ptr()) };
}
pub fn variables(&mut self) -> ExecListIter<nir_variable> {
pub fn variables(&mut self) -> ExecListIter<'_, nir_variable> {
ExecListIter::new(
&mut unsafe { self.nir.as_mut() }.variables,
offset_of!(nir_variable, node),

View file

@ -271,7 +271,7 @@ impl PipeContext {
bx: &pipe_box,
flags: pipe_map_flags,
is_buffer: bool,
) -> Option<PipeTransfer> {
) -> Option<PipeTransfer<'_>> {
let mut out: *mut pipe_transfer = ptr::null_mut();
let ptr = unsafe {
@ -297,7 +297,7 @@ impl PipeContext {
offset: i32,
size: i32,
flags: pipe_map_flags,
) -> Option<PipeTransfer> {
) -> Option<PipeTransfer<'_>> {
let b = pipe_box {
x: offset,
width: size,
@ -315,7 +315,7 @@ impl PipeContext {
offset: i32,
size: i32,
rw: RWFlags,
) -> Option<PipeTransfer> {
) -> Option<PipeTransfer<'_>> {
self.buffer_map_flags(res, offset, size, rw.into())
}
@ -328,7 +328,7 @@ impl PipeContext {
res: &PipeResource,
bx: &pipe_box,
flags: pipe_map_flags,
) -> Option<PipeTransfer> {
) -> Option<PipeTransfer<'_>> {
self.resource_map(res, bx, flags, false)
}
@ -337,7 +337,7 @@ impl PipeContext {
res: &PipeResource,
bx: &pipe_box,
rw: RWFlags,
) -> Option<PipeTransfer> {
) -> Option<PipeTransfer<'_>> {
self.texture_map_flags(res, bx, rw.into())
}

View file

@ -28,7 +28,7 @@ where
PipeQueryGen<Q>: QueryResultTrait,
{
// The external interface to create a new query
pub fn new(ctx: &PipeContext) -> Option<PipeQuery<<Self as QueryResultTrait>::ResType>> {
pub fn new(ctx: &PipeContext) -> Option<PipeQuery<'_, <Self as QueryResultTrait>::ResType>> {
PipeQuery::<<Self as QueryResultTrait>::ResType>::new(ctx, Q)
}
}

View file

@ -105,7 +105,7 @@ impl PipeScreen {
)
}
pub fn alloc_vm(&self, start: NonZeroU64, size: NonZeroU64) -> Option<ScreenVMAllocation> {
pub fn alloc_vm(&self, start: NonZeroU64, size: NonZeroU64) -> Option<ScreenVMAllocation<'_>> {
let alloc =
unsafe { self.screen().alloc_vm?(self.screen.as_ptr(), start.get(), size.get()) };
Some(ScreenVMAllocation {

View file

@ -38,7 +38,7 @@ impl DiskCacheBorrowed {
}
}
pub fn get(&self, key: &mut cache_key) -> Option<DiskCacheEntry> {
pub fn get(&self, key: &mut cache_key) -> Option<DiskCacheEntry<'_>> {
let mut size = 0;
unsafe {