Skip to content

Commit c60e455

Browse files
authored
Rollup merge of rust-lang#58828 - Centril:deny-elided_lifetimes_in_paths-libstd, r=oli-obk
libstd: deny(elided_lifetimes_in_paths) r? @oli-obk
2 parents cee58fd + 1d9508a commit c60e455

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+422
-415
lines changed

src/libstd/collections/hash/map.rs

+27-27
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ fn search_hashed_nonempty_mut<K, V, M, F>(table: M, hash: SafeHash, mut is_match
534534
}
535535
}
536536

537-
fn pop_internal<K, V>(starting_bucket: FullBucketMut<K, V>)
537+
fn pop_internal<K, V>(starting_bucket: FullBucketMut<'_, K, V>)
538538
-> (K, V, &mut RawTable<K, V>)
539539
{
540540
let (empty, retkey, retval) = starting_bucket.take();
@@ -759,7 +759,7 @@ impl<K, V, S> HashMap<K, V, S> {
759759
/// }
760760
/// ```
761761
#[stable(feature = "rust1", since = "1.0.0")]
762-
pub fn keys(&self) -> Keys<K, V> {
762+
pub fn keys(&self) -> Keys<'_, K, V> {
763763
Keys { inner: self.iter() }
764764
}
765765

@@ -781,7 +781,7 @@ impl<K, V, S> HashMap<K, V, S> {
781781
/// }
782782
/// ```
783783
#[stable(feature = "rust1", since = "1.0.0")]
784-
pub fn values(&self) -> Values<K, V> {
784+
pub fn values(&self) -> Values<'_, K, V> {
785785
Values { inner: self.iter() }
786786
}
787787

@@ -808,7 +808,7 @@ impl<K, V, S> HashMap<K, V, S> {
808808
/// }
809809
/// ```
810810
#[stable(feature = "map_values_mut", since = "1.10.0")]
811-
pub fn values_mut(&mut self) -> ValuesMut<K, V> {
811+
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> {
812812
ValuesMut { inner: self.iter_mut() }
813813
}
814814

@@ -830,7 +830,7 @@ impl<K, V, S> HashMap<K, V, S> {
830830
/// }
831831
/// ```
832832
#[stable(feature = "rust1", since = "1.0.0")]
833-
pub fn iter(&self) -> Iter<K, V> {
833+
pub fn iter(&self) -> Iter<'_, K, V> {
834834
Iter { inner: self.table.iter() }
835835
}
836836

@@ -858,7 +858,7 @@ impl<K, V, S> HashMap<K, V, S> {
858858
/// }
859859
/// ```
860860
#[stable(feature = "rust1", since = "1.0.0")]
861-
pub fn iter_mut(&mut self) -> IterMut<K, V> {
861+
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
862862
IterMut { inner: self.table.iter_mut() }
863863
}
864864

@@ -918,7 +918,7 @@ impl<K, V, S> HashMap<K, V, S> {
918918
/// ```
919919
#[inline]
920920
#[stable(feature = "drain", since = "1.6.0")]
921-
pub fn drain(&mut self) -> Drain<K, V> {
921+
pub fn drain(&mut self) -> Drain<'_, K, V> {
922922
Drain { inner: self.table.drain() }
923923
}
924924

@@ -1270,7 +1270,7 @@ impl<K, V, S> HashMap<K, V, S>
12701270
/// assert_eq!(letters.get(&'y'), None);
12711271
/// ```
12721272
#[stable(feature = "rust1", since = "1.0.0")]
1273-
pub fn entry(&mut self, key: K) -> Entry<K, V> {
1273+
pub fn entry(&mut self, key: K) -> Entry<'_, K, V> {
12741274
// Gotta resize now.
12751275
self.reserve(1);
12761276
let hash = self.make_hash(&key);
@@ -1571,7 +1571,7 @@ impl<K, V, S> HashMap<K, V, S>
15711571
/// are free to assume this doesn't happen (within the limits of memory-safety).
15721572
#[inline(always)]
15731573
#[unstable(feature = "hash_raw_entry", issue = "56167")]
1574-
pub fn raw_entry_mut(&mut self) -> RawEntryBuilderMut<K, V, S> {
1574+
pub fn raw_entry_mut(&mut self) -> RawEntryBuilderMut<'_, K, V, S> {
15751575
self.reserve(1);
15761576
RawEntryBuilderMut { map: self }
15771577
}
@@ -1592,7 +1592,7 @@ impl<K, V, S> HashMap<K, V, S>
15921592
///
15931593
/// Immutable raw entries have very limited use; you might instead want `raw_entry_mut`.
15941594
#[unstable(feature = "hash_raw_entry", issue = "56167")]
1595-
pub fn raw_entry(&self) -> RawEntryBuilder<K, V, S> {
1595+
pub fn raw_entry(&self) -> RawEntryBuilder<'_, K, V, S> {
15961596
RawEntryBuilder { map: self }
15971597
}
15981598
}
@@ -1626,7 +1626,7 @@ impl<K, V, S> Debug for HashMap<K, V, S>
16261626
V: Debug,
16271627
S: BuildHasher
16281628
{
1629-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1629+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16301630
f.debug_map().entries(self.iter()).finish()
16311631
}
16321632
}
@@ -1683,7 +1683,7 @@ impl<K, V> Clone for Iter<'_, K, V> {
16831683

16841684
#[stable(feature = "std_debug", since = "1.16.0")]
16851685
impl<K: Debug, V: Debug> fmt::Debug for Iter<'_, K, V> {
1686-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1686+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16871687
f.debug_list()
16881688
.entries(self.clone())
16891689
.finish()
@@ -1736,7 +1736,7 @@ impl<K, V> Clone for Keys<'_, K, V> {
17361736

17371737
#[stable(feature = "std_debug", since = "1.16.0")]
17381738
impl<K: Debug, V> fmt::Debug for Keys<'_, K, V> {
1739-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1739+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17401740
f.debug_list()
17411741
.entries(self.clone())
17421742
.finish()
@@ -1765,7 +1765,7 @@ impl<K, V> Clone for Values<'_, K, V> {
17651765

17661766
#[stable(feature = "std_debug", since = "1.16.0")]
17671767
impl<K, V: Debug> fmt::Debug for Values<'_, K, V> {
1768-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1768+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17691769
f.debug_list()
17701770
.entries(self.clone())
17711771
.finish()
@@ -2244,15 +2244,15 @@ impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> {
22442244

22452245
#[unstable(feature = "hash_raw_entry", issue = "56167")]
22462246
impl<K, V, S> Debug for RawEntryBuilderMut<'_, K, V, S> {
2247-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2247+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22482248
f.debug_struct("RawEntryBuilder")
22492249
.finish()
22502250
}
22512251
}
22522252

22532253
#[unstable(feature = "hash_raw_entry", issue = "56167")]
22542254
impl<K: Debug, V: Debug, S> Debug for RawEntryMut<'_, K, V, S> {
2255-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2255+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22562256
match *self {
22572257
RawEntryMut::Vacant(ref v) => {
22582258
f.debug_tuple("RawEntry")
@@ -2270,7 +2270,7 @@ impl<K: Debug, V: Debug, S> Debug for RawEntryMut<'_, K, V, S> {
22702270

22712271
#[unstable(feature = "hash_raw_entry", issue = "56167")]
22722272
impl<K: Debug, V: Debug> Debug for RawOccupiedEntryMut<'_, K, V> {
2273-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2273+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22742274
f.debug_struct("RawOccupiedEntryMut")
22752275
.field("key", self.key())
22762276
.field("value", self.get())
@@ -2280,15 +2280,15 @@ impl<K: Debug, V: Debug> Debug for RawOccupiedEntryMut<'_, K, V> {
22802280

22812281
#[unstable(feature = "hash_raw_entry", issue = "56167")]
22822282
impl<K, V, S> Debug for RawVacantEntryMut<'_, K, V, S> {
2283-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2283+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22842284
f.debug_struct("RawVacantEntryMut")
22852285
.finish()
22862286
}
22872287
}
22882288

22892289
#[unstable(feature = "hash_raw_entry", issue = "56167")]
22902290
impl<K, V, S> Debug for RawEntryBuilder<'_, K, V, S> {
2291-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2291+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22922292
f.debug_struct("RawEntryBuilder")
22932293
.finish()
22942294
}
@@ -2315,7 +2315,7 @@ pub enum Entry<'a, K: 'a, V: 'a> {
23152315

23162316
#[stable(feature= "debug_hash_map", since = "1.12.0")]
23172317
impl<K: Debug, V: Debug> Debug for Entry<'_, K, V> {
2318-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2318+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23192319
match *self {
23202320
Vacant(ref v) => {
23212321
f.debug_tuple("Entry")
@@ -2348,7 +2348,7 @@ unsafe impl<'a, K: 'a + Sync, V: 'a + Sync> Sync for OccupiedEntry<'a, K, V> {}
23482348

23492349
#[stable(feature= "debug_hash_map", since = "1.12.0")]
23502350
impl<K: Debug, V: Debug> Debug for OccupiedEntry<'_, K, V> {
2351-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2351+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23522352
f.debug_struct("OccupiedEntry")
23532353
.field("key", self.key())
23542354
.field("value", self.get())
@@ -2374,7 +2374,7 @@ unsafe impl<'a, K: 'a + Sync, V: 'a + Sync> Sync for VacantEntry<'a, K, V> {}
23742374

23752375
#[stable(feature= "debug_hash_map", since = "1.12.0")]
23762376
impl<K: Debug, V> Debug for VacantEntry<'_, K, V> {
2377-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2377+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23782378
f.debug_tuple("VacantEntry")
23792379
.field(self.key())
23802380
.finish()
@@ -2489,7 +2489,7 @@ impl<K, V> fmt::Debug for IterMut<'_, K, V>
24892489
where K: fmt::Debug,
24902490
V: fmt::Debug,
24912491
{
2492-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2492+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
24932493
f.debug_list()
24942494
.entries(self.inner.iter())
24952495
.finish()
@@ -2521,7 +2521,7 @@ impl<K, V> FusedIterator for IntoIter<K, V> {}
25212521

25222522
#[stable(feature = "std_debug", since = "1.16.0")]
25232523
impl<K: Debug, V: Debug> fmt::Debug for IntoIter<K, V> {
2524-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2524+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
25252525
f.debug_list()
25262526
.entries(self.inner.iter())
25272527
.finish()
@@ -2602,7 +2602,7 @@ impl<K, V> fmt::Debug for ValuesMut<'_, K, V>
26022602
where K: fmt::Debug,
26032603
V: fmt::Debug,
26042604
{
2605-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2605+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
26062606
f.debug_list()
26072607
.entries(self.inner.inner.iter())
26082608
.finish()
@@ -2637,7 +2637,7 @@ impl<K, V> fmt::Debug for Drain<'_, K, V>
26372637
where K: fmt::Debug,
26382638
V: fmt::Debug,
26392639
{
2640-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2640+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
26412641
f.debug_list()
26422642
.entries(self.inner.iter())
26432643
.finish()
@@ -3257,7 +3257,7 @@ impl Default for RandomState {
32573257

32583258
#[stable(feature = "std_debug", since = "1.16.0")]
32593259
impl fmt::Debug for RandomState {
3260-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3260+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
32613261
f.pad("RandomState { .. }")
32623262
}
32633263
}

src/libstd/collections/hash/set.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl<T, S> HashSet<T, S> {
182182
/// }
183183
/// ```
184184
#[stable(feature = "rust1", since = "1.0.0")]
185-
pub fn iter(&self) -> Iter<T> {
185+
pub fn iter(&self) -> Iter<'_, T> {
186186
Iter { iter: self.map.keys() }
187187
}
188188

@@ -239,7 +239,7 @@ impl<T, S> HashSet<T, S> {
239239
/// ```
240240
#[inline]
241241
#[stable(feature = "drain", since = "1.6.0")]
242-
pub fn drain(&mut self) -> Drain<T> {
242+
pub fn drain(&mut self) -> Drain<'_, T> {
243243
Drain { iter: self.map.drain() }
244244
}
245245

@@ -801,7 +801,7 @@ impl<T, S> fmt::Debug for HashSet<T, S>
801801
where T: Eq + Hash + fmt::Debug,
802802
S: BuildHasher
803803
{
804-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
804+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
805805
f.debug_set().entries(self.iter()).finish()
806806
}
807807
}
@@ -1135,7 +1135,7 @@ impl<K> FusedIterator for Iter<'_, K> {}
11351135

11361136
#[stable(feature = "std_debug", since = "1.16.0")]
11371137
impl<K: fmt::Debug> fmt::Debug for Iter<'_, K> {
1138-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1138+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11391139
f.debug_list().entries(self.clone()).finish()
11401140
}
11411141
}
@@ -1162,7 +1162,7 @@ impl<K> FusedIterator for IntoIter<K> {}
11621162

11631163
#[stable(feature = "std_debug", since = "1.16.0")]
11641164
impl<K: fmt::Debug> fmt::Debug for IntoIter<K> {
1165-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1165+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11661166
let entries_iter = self.iter
11671167
.inner
11681168
.iter()
@@ -1193,7 +1193,7 @@ impl<K> FusedIterator for Drain<'_, K> {}
11931193

11941194
#[stable(feature = "std_debug", since = "1.16.0")]
11951195
impl<K: fmt::Debug> fmt::Debug for Drain<'_, K> {
1196-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1196+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11971197
let entries_iter = self.iter
11981198
.inner
11991199
.iter()
@@ -1236,7 +1236,7 @@ impl<T, S> fmt::Debug for Intersection<'_, T, S>
12361236
where T: fmt::Debug + Eq + Hash,
12371237
S: BuildHasher
12381238
{
1239-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1239+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
12401240
f.debug_list().entries(self.clone()).finish()
12411241
}
12421242
}
@@ -1289,7 +1289,7 @@ impl<T, S> fmt::Debug for Difference<'_, T, S>
12891289
where T: fmt::Debug + Eq + Hash,
12901290
S: BuildHasher
12911291
{
1292-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1292+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
12931293
f.debug_list().entries(self.clone()).finish()
12941294
}
12951295
}
@@ -1328,7 +1328,7 @@ impl<T, S> fmt::Debug for SymmetricDifference<'_, T, S>
13281328
where T: fmt::Debug + Eq + Hash,
13291329
S: BuildHasher
13301330
{
1331-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1331+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13321332
f.debug_list().entries(self.clone()).finish()
13331333
}
13341334
}
@@ -1352,7 +1352,7 @@ impl<T, S> fmt::Debug for Union<'_, T, S>
13521352
where T: fmt::Debug + Eq + Hash,
13531353
S: BuildHasher
13541354
{
1355-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1355+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13561356
f.debug_list().entries(self.clone()).finish()
13571357
}
13581358
}

src/libstd/collections/hash/table.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -772,21 +772,21 @@ impl<K, V> RawTable<K, V> {
772772
self.size
773773
}
774774

775-
fn raw_buckets(&self) -> RawBuckets<K, V> {
775+
fn raw_buckets(&self) -> RawBuckets<'_, K, V> {
776776
RawBuckets {
777777
raw: self.raw_bucket_at(0),
778778
elems_left: self.size,
779779
marker: marker::PhantomData,
780780
}
781781
}
782782

783-
pub fn iter(&self) -> Iter<K, V> {
783+
pub fn iter(&self) -> Iter<'_, K, V> {
784784
Iter {
785785
iter: self.raw_buckets(),
786786
}
787787
}
788788

789-
pub fn iter_mut(&mut self) -> IterMut<K, V> {
789+
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
790790
IterMut {
791791
iter: self.raw_buckets(),
792792
_marker: marker::PhantomData,
@@ -806,7 +806,7 @@ impl<K, V> RawTable<K, V> {
806806
}
807807
}
808808

809-
pub fn drain(&mut self) -> Drain<K, V> {
809+
pub fn drain(&mut self) -> Drain<'_, K, V> {
810810
let RawBuckets { raw, elems_left, .. } = self.raw_buckets();
811811
// Replace the marker regardless of lifetime bounds on parameters.
812812
Drain {
@@ -936,7 +936,7 @@ unsafe impl<K: Sync, V: Sync> Sync for IterMut<'_, K, V> {}
936936
unsafe impl<K: Send, V: Send> Send for IterMut<'_, K, V> {}
937937

938938
impl<'a, K: 'a, V: 'a> IterMut<'a, K, V> {
939-
pub fn iter(&self) -> Iter<K, V> {
939+
pub fn iter(&self) -> Iter<'_, K, V> {
940940
Iter {
941941
iter: self.iter.clone(),
942942
}
@@ -953,7 +953,7 @@ unsafe impl<K: Sync, V: Sync> Sync for IntoIter<K, V> {}
953953
unsafe impl<K: Send, V: Send> Send for IntoIter<K, V> {}
954954

955955
impl<K, V> IntoIter<K, V> {
956-
pub fn iter(&self) -> Iter<K, V> {
956+
pub fn iter(&self) -> Iter<'_, K, V> {
957957
Iter {
958958
iter: self.iter.clone(),
959959
}
@@ -971,7 +971,7 @@ unsafe impl<K: Sync, V: Sync> Sync for Drain<'_, K, V> {}
971971
unsafe impl<K: Send, V: Send> Send for Drain<'_, K, V> {}
972972

973973
impl<'a, K, V> Drain<'a, K, V> {
974-
pub fn iter(&self) -> Iter<K, V> {
974+
pub fn iter(&self) -> Iter<'_, K, V> {
975975
Iter {
976976
iter: self.iter.clone(),
977977
}

0 commit comments

Comments
 (0)