Skip to content

Commit 4ae024c

Browse files
Elide more lifetimes
1 parent ae40f6a commit 4ae024c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

compiler/rustc_pattern_analysis/src/lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> {
6464
pcx.ctors_for_ty().split(pcx, column_ctors)
6565
}
6666

67-
fn iter<'b>(&'b self) -> impl Iterator<Item = &'p DeconstructedPat<'p, 'tcx>> + Captures<'b> {
67+
fn iter(&self) -> impl Iterator<Item = &'p DeconstructedPat<'p, 'tcx>> + Captures<'_> {
6868
self.patterns.iter().copied()
6969
}
7070

compiler/rustc_pattern_analysis/src/usefulness.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -851,13 +851,13 @@ impl<'p, Cx: TypeCx> PatStack<'p, Cx> {
851851
self.pats[0]
852852
}
853853

854-
fn iter<'b>(&'b self) -> impl Iterator<Item = &'p DeconstructedPat<'p, Cx>> + Captures<'b> {
854+
fn iter(&self) -> impl Iterator<Item = &'p DeconstructedPat<'p, Cx>> + Captures<'_> {
855855
self.pats.iter().copied()
856856
}
857857

858858
// Recursively expand the first or-pattern into its subpatterns. Only useful if the pattern is
859859
// an or-pattern. Panics if `self` is empty.
860-
fn expand_or_pat<'b>(&'b self) -> impl Iterator<Item = PatStack<'p, Cx>> + Captures<'b> {
860+
fn expand_or_pat(&self) -> impl Iterator<Item = PatStack<'p, Cx>> + Captures<'_> {
861861
self.head().flatten_or_pat().into_iter().map(move |pat| {
862862
let mut new = self.clone();
863863
new.pats[0] = pat;
@@ -926,13 +926,13 @@ impl<'p, Cx: TypeCx> MatrixRow<'p, Cx> {
926926
self.pats.head()
927927
}
928928

929-
fn iter<'b>(&'b self) -> impl Iterator<Item = &'p DeconstructedPat<'p, Cx>> + Captures<'b> {
929+
fn iter(&self) -> impl Iterator<Item = &'p DeconstructedPat<'p, Cx>> + Captures<'_> {
930930
self.pats.iter()
931931
}
932932

933933
// Recursively expand the first or-pattern into its subpatterns. Only useful if the pattern is
934934
// an or-pattern. Panics if `self` is empty.
935-
fn expand_or_pat<'b>(&'b self) -> impl Iterator<Item = MatrixRow<'p, Cx>> + Captures<'b> {
935+
fn expand_or_pat(&self) -> impl Iterator<Item = MatrixRow<'p, Cx>> + Captures<'_> {
936936
self.pats.expand_or_pat().map(|patstack| MatrixRow {
937937
pats: patstack,
938938
parent_row: self.parent_row,
@@ -1041,21 +1041,21 @@ impl<'p, Cx: TypeCx> Matrix<'p, Cx> {
10411041
self.wildcard_row.len()
10421042
}
10431043

1044-
fn rows<'b>(
1045-
&'b self,
1046-
) -> impl Iterator<Item = &'b MatrixRow<'p, Cx>> + Clone + DoubleEndedIterator + ExactSizeIterator
1044+
fn rows(
1045+
&self,
1046+
) -> impl Iterator<Item = &MatrixRow<'p, Cx>> + Clone + DoubleEndedIterator + ExactSizeIterator
10471047
{
10481048
self.rows.iter()
10491049
}
1050-
fn rows_mut<'b>(
1051-
&'b mut self,
1052-
) -> impl Iterator<Item = &'b mut MatrixRow<'p, Cx>> + DoubleEndedIterator + ExactSizeIterator
1050+
fn rows_mut(
1051+
&mut self,
1052+
) -> impl Iterator<Item = &mut MatrixRow<'p, Cx>> + DoubleEndedIterator + ExactSizeIterator
10531053
{
10541054
self.rows.iter_mut()
10551055
}
10561056

10571057
/// Iterate over the first pattern of each row.
1058-
fn heads<'b>(&'b self) -> impl Iterator<Item = &'b DeconstructedPat<'p, Cx>> + Clone {
1058+
fn heads(&self) -> impl Iterator<Item = &'p DeconstructedPat<'p, Cx>> + Clone + Captures<'_> {
10591059
self.rows().map(|r| r.head())
10601060
}
10611061

0 commit comments

Comments
 (0)