Skip to content

Commit 5072fd9

Browse files
committed
Use consistent style for elided lifetimes in functions
1 parent 75530e9 commit 5072fd9

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

compiler/rustc_data_structures/src/sso/map.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ impl<K, V> SsoHashMap<K, V> {
132132
/// with mutable references to the values.
133133
/// The iterator element type is `(&'a K, &'a mut V)`.
134134
#[inline]
135-
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&'_ K, &'_ mut V)> {
135+
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&K, &mut V)> {
136136
self.into_iter()
137137
}
138138

139139
/// An iterator visiting all keys in arbitrary order.
140140
/// The iterator element type is `&'a K`.
141-
pub fn keys(&self) -> impl Iterator<Item = &'_ K> {
141+
pub fn keys(&self) -> impl Iterator<Item = &K> {
142142
match self {
143143
SsoHashMap::Array(array) => Either::Left(array.iter().map(|(k, _v)| k)),
144144
SsoHashMap::Map(map) => Either::Right(map.keys()),
@@ -147,7 +147,7 @@ impl<K, V> SsoHashMap<K, V> {
147147

148148
/// An iterator visiting all values in arbitrary order.
149149
/// The iterator element type is `&'a V`.
150-
pub fn values(&self) -> impl Iterator<Item = &'_ V> {
150+
pub fn values(&self) -> impl Iterator<Item = &V> {
151151
match self {
152152
SsoHashMap::Array(array) => Either::Left(array.iter().map(|(_k, v)| v)),
153153
SsoHashMap::Map(map) => Either::Right(map.values()),
@@ -156,7 +156,7 @@ impl<K, V> SsoHashMap<K, V> {
156156

157157
/// An iterator visiting all values mutably in arbitrary order.
158158
/// The iterator element type is `&'a mut V`.
159-
pub fn values_mut(&mut self) -> impl Iterator<Item = &'_ mut V> {
159+
pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V> {
160160
match self {
161161
SsoHashMap::Array(array) => Either::Left(array.iter_mut().map(|(_k, v)| v)),
162162
SsoHashMap::Map(map) => Either::Right(map.values_mut()),

compiler/rustc_infer/src/infer/snapshot/undo_log.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl<'tcx> InferCtxtUndoLogs<'tcx> {
164164
pub(crate) fn region_constraints_in_snapshot(
165165
&self,
166166
s: &Snapshot<'tcx>,
167-
) -> impl Iterator<Item = &'_ region_constraints::UndoLog<'tcx>> + Clone {
167+
) -> impl Iterator<Item = &region_constraints::UndoLog<'tcx>> + Clone {
168168
self.logs[s.undo_len..].iter().filter_map(|log| match log {
169169
UndoLog::RegionConstraintCollector(log) => Some(log),
170170
_ => None,

compiler/rustc_middle/src/ty/list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<H, T> RawList<H, T> {
121121
//
122122
// This would be weird, as `self.into_iter` iterates over `T` directly.
123123
#[inline(always)]
124-
pub fn iter(&self) -> <&'_ RawList<H, T> as IntoIterator>::IntoIter
124+
pub fn iter(&self) -> <&RawList<H, T> as IntoIterator>::IntoIter
125125
where
126126
T: Copy,
127127
{

library/core/src/str/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ impl str {
19141914
/// ```
19151915
#[stable(feature = "str_split_once", since = "1.52.0")]
19161916
#[inline]
1917-
pub fn split_once<P: Pattern>(&self, delimiter: P) -> Option<(&'_ str, &'_ str)> {
1917+
pub fn split_once<P: Pattern>(&self, delimiter: P) -> Option<(&str, &str)> {
19181918
let (start, end) = delimiter.into_searcher(self).next_match()?;
19191919
// SAFETY: `Searcher` is known to return valid indices.
19201920
unsafe { Some((self.get_unchecked(..start), self.get_unchecked(end..))) }
@@ -1932,7 +1932,7 @@ impl str {
19321932
/// ```
19331933
#[stable(feature = "str_split_once", since = "1.52.0")]
19341934
#[inline]
1935-
pub fn rsplit_once<P: Pattern>(&self, delimiter: P) -> Option<(&'_ str, &'_ str)>
1935+
pub fn rsplit_once<P: Pattern>(&self, delimiter: P) -> Option<(&str, &str)>
19361936
where
19371937
for<'a> P::Searcher<'a>: ReverseSearcher<'a>,
19381938
{

library/std/src/collections/hash/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ where
10391039
pub fn get_disjoint_mut<Q: ?Sized, const N: usize>(
10401040
&mut self,
10411041
ks: [&Q; N],
1042-
) -> [Option<&'_ mut V>; N]
1042+
) -> [Option<&mut V>; N]
10431043
where
10441044
K: Borrow<Q>,
10451045
Q: Hash + Eq,
@@ -1106,7 +1106,7 @@ where
11061106
pub unsafe fn get_disjoint_unchecked_mut<Q: ?Sized, const N: usize>(
11071107
&mut self,
11081108
ks: [&Q; N],
1109-
) -> [Option<&'_ mut V>; N]
1109+
) -> [Option<&mut V>; N]
11101110
where
11111111
K: Borrow<Q>,
11121112
Q: Hash + Eq,

0 commit comments

Comments
 (0)