nak: fix clippy::needless_lifetimes warnings

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27234>
This commit is contained in:
Karol Herbst 2024-01-24 12:46:18 +01:00 committed by Marge Bot
parent 00a6e2ae4d
commit 3d4bd73fa3
6 changed files with 17 additions and 17 deletions

View file

@ -12,7 +12,7 @@ pub trait Builder {
self.push_instr(Instr::new_boxed(op))
}
fn predicate<'a>(&'a mut self, pred: Pred) -> PredicatedBuilder<'a, Self>
fn predicate(&mut self, pred: Pred) -> PredicatedBuilder<'_, Self>
where
Self: Sized,
{

View file

@ -329,7 +329,7 @@ impl<N> CFG<N> {
&self.nodes[idx].pred[..]
}
pub fn drain<'a>(&'a mut self) -> impl Iterator<Item = N> + 'a {
pub fn drain(&mut self) -> impl Iterator<Item = N> + '_ {
self.has_loop = false;
self.nodes.drain(..).map(|n| n.node)
}

View file

@ -2787,10 +2787,10 @@ impl<'a> ShaderFromNir<'a> {
b.push_op(OpFSOut { srcs: srcs });
}
fn parse_block<'b>(
fn parse_block(
&mut self,
ssa_alloc: &mut SSAValueAllocator,
phi_map: &mut PhiAllocMap<'b>,
phi_map: &mut PhiAllocMap,
nb: &nir_block,
) {
let mut b = SSAInstrBuilder::new(self.info.sm, ssa_alloc);
@ -2933,29 +2933,29 @@ impl<'a> ShaderFromNir<'a> {
self.cfg.add_node(nb.index, bb);
}
fn parse_if<'b>(
fn parse_if(
&mut self,
ssa_alloc: &mut SSAValueAllocator,
phi_map: &mut PhiAllocMap<'b>,
phi_map: &mut PhiAllocMap,
ni: &nir_if,
) {
self.parse_cf_list(ssa_alloc, phi_map, ni.iter_then_list());
self.parse_cf_list(ssa_alloc, phi_map, ni.iter_else_list());
}
fn parse_loop<'b>(
fn parse_loop(
&mut self,
ssa_alloc: &mut SSAValueAllocator,
phi_map: &mut PhiAllocMap<'b>,
phi_map: &mut PhiAllocMap,
nl: &nir_loop,
) {
self.parse_cf_list(ssa_alloc, phi_map, nl.iter_body());
}
fn parse_cf_list<'b>(
fn parse_cf_list(
&mut self,
ssa_alloc: &mut SSAValueAllocator,
phi_map: &mut PhiAllocMap<'b>,
phi_map: &mut PhiAllocMap,
list: ExecListIter<nir_cf_node>,
) {
for node in list {

View file

@ -428,7 +428,7 @@ impl NextUseBlockLiveness {
}
/// Returns an iterator over all the values which are live-in to this block
pub fn iter_live_in<'a>(&'a self) -> impl Iterator<Item = &'a SSAValue> {
pub fn iter_live_in(&self) -> impl Iterator<Item = &SSAValue> {
self.ssa_map.iter().filter_map(|(ssa, entry)| {
if entry.defined || entry.uses.is_empty() {
None

View file

@ -151,11 +151,11 @@ impl AsConst for nir_src {
}
pub trait AsDef {
fn as_def<'a>(&'a self) -> &'a nir_def;
fn as_def(&self) -> &nir_def;
}
impl AsDef for nir_def {
fn as_def<'a>(&'a self) -> &'a nir_def {
fn as_def(&self) -> &nir_def {
self
}
}
@ -176,7 +176,7 @@ impl<T: AsDef> NirValue for T {
}
impl AsDef for nir_src {
fn as_def<'a>(&'a self) -> &'a nir_def {
fn as_def(&self) -> &nir_def {
unsafe { &*self.ssa }
}
}
@ -220,7 +220,7 @@ impl NirSrcsAsSlice<nir_alu_src> for nir_alu_instr {
}
impl AsDef for nir_alu_src {
fn as_def<'a>(&'a self) -> &'a nir_def {
fn as_def(&self) -> &nir_def {
self.src.as_def()
}
}

View file

@ -80,7 +80,7 @@ fn get_ssa_or_phi(
}
}
fn get_or_insert_phi_dsts<'a>(bb: &'a mut BasicBlock) -> &'a mut OpPhiDsts {
fn get_or_insert_phi_dsts(bb: &mut BasicBlock) -> &mut OpPhiDsts {
let has_phi = match &bb.instrs[0].op {
Op::PhiDsts(_) => true,
_ => false,
@ -94,7 +94,7 @@ fn get_or_insert_phi_dsts<'a>(bb: &'a mut BasicBlock) -> &'a mut OpPhiDsts {
}
}
fn get_or_insert_phi_srcs<'a>(bb: &'a mut BasicBlock) -> &'a mut OpPhiSrcs {
fn get_or_insert_phi_srcs(bb: &mut BasicBlock) -> &mut OpPhiSrcs {
let mut has_phi = false;
let mut ip = bb.instrs.len();
for (i, instr) in bb.instrs.iter_mut().enumerate().rev() {