diff --git a/compiler/rustc_pattern_analysis/src/lints.rs b/compiler/rustc_pattern_analysis/src/lints.rs index e8b714204a3..e78cbd13822 100644 --- a/compiler/rustc_pattern_analysis/src/lints.rs +++ b/compiler/rustc_pattern_analysis/src/lints.rs @@ -64,7 +64,7 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> { pcx.ctors_for_ty().split(pcx, column_ctors) } - fn iter<'b>(&'b self) -> impl Iterator> + Captures<'b> { + fn iter(&self) -> impl Iterator> + Captures<'_> { self.patterns.iter().copied() } diff --git a/compiler/rustc_pattern_analysis/src/usefulness.rs b/compiler/rustc_pattern_analysis/src/usefulness.rs index 80210c6b973..d2e621a6b98 100644 --- a/compiler/rustc_pattern_analysis/src/usefulness.rs +++ b/compiler/rustc_pattern_analysis/src/usefulness.rs @@ -851,13 +851,13 @@ impl<'p, Cx: TypeCx> PatStack<'p, Cx> { self.pats[0] } - fn iter<'b>(&'b self) -> impl Iterator> + Captures<'b> { + fn iter(&self) -> impl Iterator> + Captures<'_> { self.pats.iter().copied() } // Recursively expand the first or-pattern into its subpatterns. Only useful if the pattern is // an or-pattern. Panics if `self` is empty. - fn expand_or_pat<'b>(&'b self) -> impl Iterator> + Captures<'b> { + fn expand_or_pat(&self) -> impl Iterator> + Captures<'_> { self.head().flatten_or_pat().into_iter().map(move |pat| { let mut new = self.clone(); new.pats[0] = pat; @@ -926,13 +926,13 @@ impl<'p, Cx: TypeCx> MatrixRow<'p, Cx> { self.pats.head() } - fn iter<'b>(&'b self) -> impl Iterator> + Captures<'b> { + fn iter(&self) -> impl Iterator> + Captures<'_> { self.pats.iter() } // Recursively expand the first or-pattern into its subpatterns. Only useful if the pattern is // an or-pattern. Panics if `self` is empty. - fn expand_or_pat<'b>(&'b self) -> impl Iterator> + Captures<'b> { + fn expand_or_pat(&self) -> impl Iterator> + Captures<'_> { self.pats.expand_or_pat().map(|patstack| MatrixRow { pats: patstack, parent_row: self.parent_row, @@ -1041,21 +1041,21 @@ impl<'p, Cx: TypeCx> Matrix<'p, Cx> { self.wildcard_row.len() } - fn rows<'b>( - &'b self, - ) -> impl Iterator> + Clone + DoubleEndedIterator + ExactSizeIterator + fn rows( + &self, + ) -> impl Iterator> + Clone + DoubleEndedIterator + ExactSizeIterator { self.rows.iter() } - fn rows_mut<'b>( - &'b mut self, - ) -> impl Iterator> + DoubleEndedIterator + ExactSizeIterator + fn rows_mut( + &mut self, + ) -> impl Iterator> + DoubleEndedIterator + ExactSizeIterator { self.rows.iter_mut() } /// Iterate over the first pattern of each row. - fn heads<'b>(&'b self) -> impl Iterator> + Clone { + fn heads(&self) -> impl Iterator> + Clone + Captures<'_> { self.rows().map(|r| r.head()) }