mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
compiler/rust: fix errors about hiding elided lifetime
In some setups the rust compiler emits errors like the following:
-----------------------------------------------------------------------
error: hiding a lifetime that's elided elsewhere is confusing
--> ../subprojects/proc-macro2-1.0.86/src/parse.rs:125:25
|
125 | fn block_comment(input: Cursor) -> PResult<&str> {
| ^^^^^^ -------------
| | | |
| | | the same lifetime is elided here
| | the same lifetime is hidden here
| the lifetime is hidden here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
= note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]`
help: use `'_` for type paths
|
125 | fn block_comment(input: Cursor<'_>) -> PResult<'_, &str> {
| ++++ +++
-----------------------------------------------------------------------
Follow the solution suggested by the compiler to silence the errors, for
all the observed occurrences.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36849>
This commit is contained in:
parent
5c019bdee5
commit
8f84ae7de7
3 changed files with 12 additions and 12 deletions
|
|
@ -275,12 +275,12 @@ impl<N> CFG<N> {
|
|||
}
|
||||
|
||||
/// Returns an iterator over the nodes.
|
||||
pub fn iter(&self) -> slice::Iter<CFGNode<N>> {
|
||||
pub fn iter(&self) -> slice::Iter<'_, CFGNode<N>> {
|
||||
self.nodes.iter()
|
||||
}
|
||||
|
||||
/// Returns a mutable iterator over the nodes.
|
||||
pub fn iter_mut(&mut self) -> slice::IterMut<CFGNode<N>> {
|
||||
pub fn iter_mut(&mut self) -> slice::IterMut<'_, CFGNode<N>> {
|
||||
self.nodes.iter_mut()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ impl nir_phi_src {
|
|||
}
|
||||
|
||||
impl nir_phi_instr {
|
||||
pub fn iter_srcs(&self) -> ExecListIter<nir_phi_src> {
|
||||
pub fn iter_srcs(&self) -> ExecListIter<'_, nir_phi_src> {
|
||||
ExecListIter::new(&self.srcs, offset_of!(nir_phi_src, node))
|
||||
}
|
||||
}
|
||||
|
|
@ -494,7 +494,7 @@ impl nir_instr {
|
|||
}
|
||||
|
||||
impl nir_block {
|
||||
pub fn iter_instr_list(&self) -> ExecListIter<nir_instr> {
|
||||
pub fn iter_instr_list(&self) -> ExecListIter<'_, nir_instr> {
|
||||
ExecListIter::new(&self.instr_list, offset_of!(nir_instr, node))
|
||||
}
|
||||
|
||||
|
|
@ -529,11 +529,11 @@ impl nir_if {
|
|||
self.iter_else_list().next().unwrap().as_block().unwrap()
|
||||
}
|
||||
|
||||
pub fn iter_then_list(&self) -> ExecListIter<nir_cf_node> {
|
||||
pub fn iter_then_list(&self) -> ExecListIter<'_, nir_cf_node> {
|
||||
ExecListIter::new(&self.then_list, offset_of!(nir_cf_node, node))
|
||||
}
|
||||
|
||||
pub fn iter_else_list(&self) -> ExecListIter<nir_cf_node> {
|
||||
pub fn iter_else_list(&self) -> ExecListIter<'_, nir_cf_node> {
|
||||
ExecListIter::new(&self.else_list, offset_of!(nir_cf_node, node))
|
||||
}
|
||||
|
||||
|
|
@ -543,7 +543,7 @@ impl nir_if {
|
|||
}
|
||||
|
||||
impl nir_loop {
|
||||
pub fn iter_body(&self) -> ExecListIter<nir_cf_node> {
|
||||
pub fn iter_body(&self) -> ExecListIter<'_, nir_cf_node> {
|
||||
ExecListIter::new(&self.body, offset_of!(nir_cf_node, node))
|
||||
}
|
||||
|
||||
|
|
@ -599,7 +599,7 @@ impl nir_cf_node {
|
|||
}
|
||||
|
||||
impl nir_function_impl {
|
||||
pub fn iter_body(&self) -> ExecListIter<nir_cf_node> {
|
||||
pub fn iter_body(&self) -> ExecListIter<'_, nir_cf_node> {
|
||||
ExecListIter::new(&self.body, offset_of!(nir_cf_node, node))
|
||||
}
|
||||
|
||||
|
|
@ -619,11 +619,11 @@ impl nir_function {
|
|||
}
|
||||
|
||||
impl nir_shader {
|
||||
pub fn iter_functions(&self) -> ExecListIter<nir_function> {
|
||||
pub fn iter_functions(&self) -> ExecListIter<'_, nir_function> {
|
||||
ExecListIter::new(&self.functions, offset_of!(nir_function, node))
|
||||
}
|
||||
|
||||
pub fn iter_variables(&self) -> ExecListIter<nir_variable> {
|
||||
pub fn iter_variables(&self) -> ExecListIter<'_, nir_variable> {
|
||||
ExecListIter::new(&self.variables, offset_of!(nir_variable, node))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -337,12 +337,12 @@ impl<T> PerRegFile<T> {
|
|||
}
|
||||
|
||||
/// Iterates over the values in this container.
|
||||
pub fn values(&self) -> slice::Iter<T> {
|
||||
pub fn values(&self) -> slice::Iter<'_, T> {
|
||||
self.per_file.iter()
|
||||
}
|
||||
|
||||
/// Iterates over the mutable values in this container.
|
||||
pub fn values_mut(&mut self) -> slice::IterMut<T> {
|
||||
pub fn values_mut(&mut self) -> slice::IterMut<'_, T> {
|
||||
self.per_file.iter_mut()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue