Skip to content

Commit 0a5fe40

Browse files
authored
Rollup merge of #60098 - Centril:libcore-deny-more, r=varkor
libcore: deny `elided_lifetimes_in_paths` r? @varkor
2 parents 39ab46a + dbfbade commit 0a5fe40

37 files changed

+233
-236
lines changed

src/libcore/alloc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ pub struct LayoutErr {
338338
// (we need this for downstream impl of trait Error)
339339
#[stable(feature = "alloc_layout", since = "1.28.0")]
340340
impl fmt::Display for LayoutErr {
341-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
341+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
342342
f.write_str("invalid parameters to Layout::from_size_align")
343343
}
344344
}
@@ -354,7 +354,7 @@ pub struct AllocErr;
354354
// (we need this for downstream impl of trait Error)
355355
#[unstable(feature = "allocator_api", issue = "32838")]
356356
impl fmt::Display for AllocErr {
357-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
357+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
358358
f.write_str("memory allocation failed")
359359
}
360360
}
@@ -376,7 +376,7 @@ impl CannotReallocInPlace {
376376
// (we need this for downstream impl of trait Error)
377377
#[unstable(feature = "allocator_api", issue = "32838")]
378378
impl fmt::Display for CannotReallocInPlace {
379-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
379+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
380380
write!(f, "{}", self.description())
381381
}
382382
}

src/libcore/any.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<T: 'static + ?Sized > Any for T {
107107

108108
#[stable(feature = "rust1", since = "1.0.0")]
109109
impl fmt::Debug for dyn Any {
110-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
110+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
111111
f.pad("Any")
112112
}
113113
}
@@ -117,14 +117,14 @@ impl fmt::Debug for dyn Any {
117117
// dispatch works with upcasting.
118118
#[stable(feature = "rust1", since = "1.0.0")]
119119
impl fmt::Debug for dyn Any + Send {
120-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
120+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
121121
f.pad("Any")
122122
}
123123
}
124124

125125
#[stable(feature = "any_send_sync_methods", since = "1.28.0")]
126126
impl fmt::Debug for dyn Any + Send + Sync {
127-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
127+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
128128
f.pad("Any")
129129
}
130130
}

src/libcore/array.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub struct TryFromSliceError(());
5555

5656
impl fmt::Display for TryFromSliceError {
5757
#[inline]
58-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
58+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5959
fmt::Display::fmt(self.__description(), f)
6060
}
6161
}
@@ -184,7 +184,7 @@ macro_rules! array_impls {
184184

185185
#[stable(feature = "rust1", since = "1.0.0")]
186186
impl<T: fmt::Debug> fmt::Debug for [T; $N] {
187-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
187+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
188188
fmt::Debug::fmt(&&self[..], f)
189189
}
190190
}

src/libcore/ascii.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl FusedIterator for EscapeDefault {}
131131

132132
#[stable(feature = "std_debug", since = "1.16.0")]
133133
impl fmt::Debug for EscapeDefault {
134-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
134+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
135135
f.pad("EscapeDefault { .. }")
136136
}
137137
}

src/libcore/cell.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -577,14 +577,14 @@ pub struct BorrowError {
577577

578578
#[stable(feature = "try_borrow", since = "1.13.0")]
579579
impl Debug for BorrowError {
580-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
580+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
581581
f.debug_struct("BorrowError").finish()
582582
}
583583
}
584584

585585
#[stable(feature = "try_borrow", since = "1.13.0")]
586586
impl Display for BorrowError {
587-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
587+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
588588
Display::fmt("already mutably borrowed", f)
589589
}
590590
}
@@ -597,14 +597,14 @@ pub struct BorrowMutError {
597597

598598
#[stable(feature = "try_borrow", since = "1.13.0")]
599599
impl Debug for BorrowMutError {
600-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
600+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
601601
f.debug_struct("BorrowMutError").finish()
602602
}
603603
}
604604

605605
#[stable(feature = "try_borrow", since = "1.13.0")]
606606
impl Display for BorrowMutError {
607-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
607+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
608608
Display::fmt("already borrowed", f)
609609
}
610610
}
@@ -788,7 +788,7 @@ impl<T: ?Sized> RefCell<T> {
788788
/// ```
789789
#[stable(feature = "rust1", since = "1.0.0")]
790790
#[inline]
791-
pub fn borrow(&self) -> Ref<T> {
791+
pub fn borrow(&self) -> Ref<'_, T> {
792792
self.try_borrow().expect("already mutably borrowed")
793793
}
794794

@@ -819,7 +819,7 @@ impl<T: ?Sized> RefCell<T> {
819819
/// ```
820820
#[stable(feature = "try_borrow", since = "1.13.0")]
821821
#[inline]
822-
pub fn try_borrow(&self) -> Result<Ref<T>, BorrowError> {
822+
pub fn try_borrow(&self) -> Result<Ref<'_, T>, BorrowError> {
823823
match BorrowRef::new(&self.borrow) {
824824
Some(b) => Ok(Ref {
825825
value: unsafe { &*self.value.get() },
@@ -869,7 +869,7 @@ impl<T: ?Sized> RefCell<T> {
869869
/// ```
870870
#[stable(feature = "rust1", since = "1.0.0")]
871871
#[inline]
872-
pub fn borrow_mut(&self) -> RefMut<T> {
872+
pub fn borrow_mut(&self) -> RefMut<'_, T> {
873873
self.try_borrow_mut().expect("already borrowed")
874874
}
875875

@@ -897,7 +897,7 @@ impl<T: ?Sized> RefCell<T> {
897897
/// ```
898898
#[stable(feature = "try_borrow", since = "1.13.0")]
899899
#[inline]
900-
pub fn try_borrow_mut(&self) -> Result<RefMut<T>, BorrowMutError> {
900+
pub fn try_borrow_mut(&self) -> Result<RefMut<'_, T>, BorrowMutError> {
901901
match BorrowRefMut::new(&self.borrow) {
902902
Some(b) => Ok(RefMut {
903903
value: unsafe { &mut *self.value.get() },
@@ -1245,7 +1245,7 @@ impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b,
12451245

12461246
#[stable(feature = "std_guard_impls", since = "1.20.0")]
12471247
impl<T: ?Sized + fmt::Display> fmt::Display for Ref<'_, T> {
1248-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1248+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
12491249
self.value.fmt(f)
12501250
}
12511251
}
@@ -1402,7 +1402,7 @@ impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefM
14021402

14031403
#[stable(feature = "std_guard_impls", since = "1.20.0")]
14041404
impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
1405-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1405+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14061406
self.value.fmt(f)
14071407
}
14081408
}

src/libcore/char/convert.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ enum CharErrorKind {
193193

194194
#[stable(feature = "char_from_str", since = "1.20.0")]
195195
impl fmt::Display for ParseCharError {
196-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
196+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
197197
self.__description().fmt(f)
198198
}
199199
}
@@ -240,7 +240,7 @@ pub struct CharTryFromError(());
240240

241241
#[stable(feature = "try_from", since = "1.34.0")]
242242
impl fmt::Display for CharTryFromError {
243-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
243+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
244244
"converted integer out of range for `char`".fmt(f)
245245
}
246246
}
@@ -316,4 +316,3 @@ pub fn from_digit(num: u32, radix: u32) -> Option<char> {
316316
None
317317
}
318318
}
319-

src/libcore/char/decode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl DecodeUtf16Error {
128128

129129
#[stable(feature = "decode_utf16", since = "1.9.0")]
130130
impl fmt::Display for DecodeUtf16Error {
131-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
131+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
132132
write!(f, "unpaired surrogate found: {:x}", self.code)
133133
}
134134
}

src/libcore/char/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl FusedIterator for EscapeUnicode {}
220220

221221
#[stable(feature = "char_struct_display", since = "1.16.0")]
222222
impl fmt::Display for EscapeUnicode {
223-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
223+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
224224
for c in self.clone() {
225225
f.write_char(c)?;
226226
}
@@ -333,7 +333,7 @@ impl FusedIterator for EscapeDefault {}
333333

334334
#[stable(feature = "char_struct_display", since = "1.16.0")]
335335
impl fmt::Display for EscapeDefault {
336-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
336+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
337337
for c in self.clone() {
338338
f.write_char(c)?;
339339
}
@@ -367,7 +367,7 @@ impl FusedIterator for EscapeDebug {}
367367

368368
#[stable(feature = "char_escape_debug", since = "1.20.0")]
369369
impl fmt::Display for EscapeDebug {
370-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
370+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
371371
fmt::Display::fmt(&self.0, f)
372372
}
373373
}
@@ -482,7 +482,7 @@ impl Iterator for CaseMappingIter {
482482
}
483483

484484
impl fmt::Display for CaseMappingIter {
485-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
485+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
486486
match *self {
487487
CaseMappingIter::Three(a, b, c) => {
488488
f.write_char(a)?;
@@ -503,14 +503,14 @@ impl fmt::Display for CaseMappingIter {
503503

504504
#[stable(feature = "char_struct_display", since = "1.16.0")]
505505
impl fmt::Display for ToLowercase {
506-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
506+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
507507
fmt::Display::fmt(&self.0, f)
508508
}
509509
}
510510

511511
#[stable(feature = "char_struct_display", since = "1.16.0")]
512512
impl fmt::Display for ToUppercase {
513-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
513+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
514514
fmt::Display::fmt(&self.0, f)
515515
}
516516
}

src/libcore/ffi.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub enum c_void {
3939

4040
#[stable(feature = "std_debug", since = "1.16.0")]
4141
impl fmt::Debug for c_void {
42-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
42+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4343
f.pad("c_void")
4444
}
4545
}
@@ -62,7 +62,7 @@ extern {
6262
all(target_arch = "aarch64", target_os = "ios"),
6363
windows))]
6464
impl fmt::Debug for VaListImpl {
65-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
65+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6666
write!(f, "va_list* {:p}", self)
6767
}
6868
}
@@ -212,7 +212,7 @@ impl<'a> VaList<'a> {
212212
extern "rust-intrinsic" {
213213
/// Destroy the arglist `ap` after initialization with `va_start` or
214214
/// `va_copy`.
215-
fn va_end(ap: &mut VaList);
215+
fn va_end(ap: &mut VaList<'_>);
216216

217217
/// Copies the current location of arglist `src` to the arglist `dst`.
218218
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
@@ -222,9 +222,9 @@ extern "rust-intrinsic" {
222222
fn va_copy<'a>(src: &VaList<'a>) -> VaList<'a>;
223223
#[cfg(all(any(target_arch = "aarch64", target_arch = "powerpc", target_arch = "x86_64"),
224224
not(windows), not(all(target_arch = "aarch64", target_os = "ios"))))]
225-
fn va_copy(src: &VaList) -> VaListImpl;
225+
fn va_copy(src: &VaList<'_>) -> VaListImpl;
226226

227227
/// Loads an argument of type `T` from the `va_list` `ap` and increment the
228228
/// argument `ap` points to.
229-
fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaList) -> T;
229+
fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaList<'_>) -> T;
230230
}

src/libcore/fmt/builders.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct PadAdapter<'a> {
66
}
77

88
impl<'a> PadAdapter<'a> {
9-
fn wrap<'b, 'c: 'a+'b>(fmt: &'c mut fmt::Formatter, slot: &'b mut Option<Self>)
9+
fn wrap<'b, 'c: 'a+'b>(fmt: &'c mut fmt::Formatter<'_>, slot: &'b mut Option<Self>)
1010
-> fmt::Formatter<'b> {
1111
fmt.wrap_buf(move |buf| {
1212
*slot = Some(PadAdapter {

0 commit comments

Comments
 (0)