diff options
| author | Michael Goulet <michael@errs.io> | 2023-12-26 02:12:33 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-12-26 02:12:33 +0000 |
| commit | 4ae024c75489eca46dfacad5aa6f33023acce635 (patch) | |
| tree | 9d0974315e51adfa41df9cbaae6759604ac7f4af /compiler/rustc_pattern_analysis/src | |
| parent | ae40f6a7ffdda1f58794e25db2d8c9798cfe1e40 (diff) | |
| download | rust-4ae024c75489eca46dfacad5aa6f33023acce635.tar.gz rust-4ae024c75489eca46dfacad5aa6f33023acce635.zip | |
Elide more lifetimes
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/lints.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/usefulness.rs | 22 |
2 files changed, 12 insertions, 12 deletions
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<Item = &'p DeconstructedPat<'p, 'tcx>> + Captures<'b> { + fn iter(&self) -> impl Iterator<Item = &'p DeconstructedPat<'p, 'tcx>> + 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<Item = &'p DeconstructedPat<'p, Cx>> + Captures<'b> { + fn iter(&self) -> impl Iterator<Item = &'p DeconstructedPat<'p, Cx>> + 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<Item = PatStack<'p, Cx>> + Captures<'b> { + fn expand_or_pat(&self) -> impl Iterator<Item = PatStack<'p, Cx>> + 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<Item = &'p DeconstructedPat<'p, Cx>> + Captures<'b> { + fn iter(&self) -> impl Iterator<Item = &'p DeconstructedPat<'p, Cx>> + 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<Item = MatrixRow<'p, Cx>> + Captures<'b> { + fn expand_or_pat(&self) -> impl Iterator<Item = MatrixRow<'p, Cx>> + 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<Item = &'b MatrixRow<'p, Cx>> + Clone + DoubleEndedIterator + ExactSizeIterator + fn rows( + &self, + ) -> impl Iterator<Item = &MatrixRow<'p, Cx>> + Clone + DoubleEndedIterator + ExactSizeIterator { self.rows.iter() } - fn rows_mut<'b>( - &'b mut self, - ) -> impl Iterator<Item = &'b mut MatrixRow<'p, Cx>> + DoubleEndedIterator + ExactSizeIterator + fn rows_mut( + &mut self, + ) -> impl Iterator<Item = &mut MatrixRow<'p, Cx>> + DoubleEndedIterator + ExactSizeIterator { self.rows.iter_mut() } /// Iterate over the first pattern of each row. - fn heads<'b>(&'b self) -> impl Iterator<Item = &'b DeconstructedPat<'p, Cx>> + Clone { + fn heads(&self) -> impl Iterator<Item = &'p DeconstructedPat<'p, Cx>> + Clone + Captures<'_> { self.rows().map(|r| r.head()) } |
