Use impl_header_lifetime_elision in libcore

This commit is contained in:
Scott McMurray 2018-09-03 04:50:14 -07:00
parent 6310be458f
commit 0a3bd9b6ab
23 changed files with 149 additions and 148 deletions

View file

@ -226,16 +226,16 @@ impl<T: ?Sized> BorrowMut<T> for T {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Borrow<T> for &'a T {
impl<T: ?Sized> Borrow<T> for &T {
fn borrow(&self) -> &T { &**self }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Borrow<T> for &'a mut T {
impl<T: ?Sized> Borrow<T> for &mut T {
fn borrow(&self) -> &T { &**self }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> BorrowMut<T> for &'a mut T {
impl<T: ?Sized> BorrowMut<T> for &mut T {
fn borrow_mut(&mut self) -> &mut T { &mut **self }
}

View file

@ -1092,7 +1092,7 @@ impl<'b> BorrowRef<'b> {
}
}
impl<'b> Drop for BorrowRef<'b> {
impl Drop for BorrowRef<'_> {
#[inline]
fn drop(&mut self) {
let borrow = self.borrow.get();
@ -1101,9 +1101,9 @@ impl<'b> Drop for BorrowRef<'b> {
}
}
impl<'b> Clone for BorrowRef<'b> {
impl Clone for BorrowRef<'_> {
#[inline]
fn clone(&self) -> BorrowRef<'b> {
fn clone(&self) -> Self {
// Since this Ref exists, we know the borrow flag
// is a reading borrow.
let borrow = self.borrow.get();
@ -1127,7 +1127,7 @@ pub struct Ref<'b, T: ?Sized + 'b> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'b, T: ?Sized> Deref for Ref<'b, T> {
impl<T: ?Sized> Deref for Ref<'_, T> {
type Target = T;
#[inline]
@ -1219,7 +1219,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b, T> {}
#[stable(feature = "std_guard_impls", since = "1.20.0")]
impl<'a, T: ?Sized + fmt::Display> fmt::Display for Ref<'a, T> {
impl<T: ?Sized + fmt::Display> fmt::Display for Ref<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.value.fmt(f)
}
@ -1305,7 +1305,7 @@ struct BorrowRefMut<'b> {
borrow: &'b Cell<BorrowFlag>,
}
impl<'b> Drop for BorrowRefMut<'b> {
impl Drop for BorrowRefMut<'_> {
#[inline]
fn drop(&mut self) {
let borrow = self.borrow.get();
@ -1356,7 +1356,7 @@ pub struct RefMut<'b, T: ?Sized + 'b> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'b, T: ?Sized> Deref for RefMut<'b, T> {
impl<T: ?Sized> Deref for RefMut<'_, T> {
type Target = T;
#[inline]
@ -1366,7 +1366,7 @@ impl<'b, T: ?Sized> Deref for RefMut<'b, T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
impl<T: ?Sized> DerefMut for RefMut<'_, T> {
#[inline]
fn deref_mut(&mut self) -> &mut T {
self.value
@ -1377,7 +1377,7 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefMut<'b, T> {}
#[stable(feature = "std_guard_impls", since = "1.20.0")]
impl<'a, T: ?Sized + fmt::Display> fmt::Display for RefMut<'a, T> {
impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.value.fmt(f)
}

View file

@ -204,7 +204,7 @@ mod impls {
// Shared references can be cloned, but mutable references *cannot*!
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Clone for &'a T {
impl<T: ?Sized> Clone for &T {
#[inline]
fn clone(&self) -> Self {
*self

View file

@ -1033,12 +1033,12 @@ mod impls {
fn gt(&self, other: & &'b B) -> bool { PartialOrd::gt(*self, *other) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, A: ?Sized> Ord for &'a A where A: Ord {
impl<A: ?Sized> Ord for &A where A: Ord {
#[inline]
fn cmp(&self, other: & &'a A) -> Ordering { Ord::cmp(*self, *other) }
fn cmp(&self, other: &Self) -> Ordering { Ord::cmp(*self, *other) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, A: ?Sized> Eq for &'a A where A: Eq {}
impl<A: ?Sized> Eq for &A where A: Eq {}
// &mut pointers
@ -1065,12 +1065,12 @@ mod impls {
fn gt(&self, other: &&'b mut B) -> bool { PartialOrd::gt(*self, *other) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, A: ?Sized> Ord for &'a mut A where A: Ord {
impl<A: ?Sized> Ord for &mut A where A: Ord {
#[inline]
fn cmp(&self, other: &&'a mut A) -> Ordering { Ord::cmp(*self, *other) }
fn cmp(&self, other: &Self) -> Ordering { Ord::cmp(*self, *other) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, A: ?Sized> Eq for &'a mut A where A: Eq {}
impl<A: ?Sized> Eq for &mut A where A: Eq {}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a A where A: PartialEq<B> {

View file

@ -407,7 +407,7 @@ pub trait TryFrom<T>: Sized {
// As lifts over &
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a T where T: AsRef<U>
impl<T: ?Sized, U: ?Sized> AsRef<U> for &T where T: AsRef<U>
{
fn as_ref(&self) -> &U {
<T as AsRef<U>>::as_ref(*self)
@ -416,7 +416,7 @@ impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a T where T: AsRef<U>
// As lifts over &mut
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a mut T where T: AsRef<U>
impl<T: ?Sized, U: ?Sized> AsRef<U> for &mut T where T: AsRef<U>
{
fn as_ref(&self) -> &U {
<T as AsRef<U>>::as_ref(*self)
@ -433,7 +433,7 @@ impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a mut T where T: AsRef<U>
// AsMut lifts over &mut
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized, U: ?Sized> AsMut<U> for &'a mut T where T: AsMut<U>
impl<T: ?Sized, U: ?Sized> AsMut<U> for &mut T where T: AsMut<U>
{
fn as_mut(&mut self) -> &mut U {
(*self).as_mut()

View file

@ -28,7 +28,7 @@ impl<'a> PadAdapter<'a> {
}
}
impl<'a> fmt::Write for PadAdapter<'a> {
impl fmt::Write for PadAdapter<'_> {
fn write_str(&mut self, mut s: &str) -> fmt::Result {
while !s.is_empty() {
if self.on_newline {

View file

@ -208,7 +208,7 @@ pub trait Write {
// requiring a `Sized` bound.
struct Adapter<'a,T: ?Sized +'a>(&'a mut T);
impl<'a, T: ?Sized> Write for Adapter<'a, T>
impl<T: ?Sized> Write for Adapter<'_, T>
where T: Write
{
fn write_str(&mut self, s: &str) -> Result {
@ -229,7 +229,7 @@ pub trait Write {
}
#[stable(feature = "fmt_write_blanket_impl", since = "1.4.0")]
impl<'a, W: Write + ?Sized> Write for &'a mut W {
impl<W: Write + ?Sized> Write for &mut W {
fn write_str(&mut self, s: &str) -> Result {
(**self).write_str(s)
}
@ -291,8 +291,8 @@ pub struct ArgumentV1<'a> {
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
issue = "0")]
impl<'a> Clone for ArgumentV1<'a> {
fn clone(&self) -> ArgumentV1<'a> {
impl Clone for ArgumentV1<'_> {
fn clone(&self) -> Self {
*self
}
}
@ -436,14 +436,14 @@ pub struct Arguments<'a> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> Debug for Arguments<'a> {
impl Debug for Arguments<'_> {
fn fmt(&self, fmt: &mut Formatter) -> Result {
Display::fmt(self, fmt)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> Display for Arguments<'a> {
impl Display for Arguments<'_> {
fn fmt(&self, fmt: &mut Formatter) -> Result {
write(fmt.buf, *self)
}
@ -1884,7 +1884,7 @@ impl<'a> Formatter<'a> {
}
#[stable(since = "1.2.0", feature = "formatter_write")]
impl<'a> Write for Formatter<'a> {
impl Write for Formatter<'_> {
fn write_str(&mut self, s: &str) -> Result {
self.buf.write_str(s)
}
@ -1911,11 +1911,11 @@ macro_rules! fmt_refs {
($($tr:ident),*) => {
$(
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized + $tr> $tr for &'a T {
impl<T: ?Sized + $tr> $tr for &T {
fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized + $tr> $tr for &'a mut T {
impl<T: ?Sized + $tr> $tr for &mut T {
fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
}
)*
@ -2039,14 +2039,14 @@ impl<T: ?Sized> Pointer for *mut T {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Pointer for &'a T {
impl<T: ?Sized> Pointer for &T {
fn fmt(&self, f: &mut Formatter) -> Result {
Pointer::fmt(&(*self as *const T), f)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Pointer for &'a mut T {
impl<T: ?Sized> Pointer for &mut T {
fn fmt(&self, f: &mut Formatter) -> Result {
Pointer::fmt(&(&**self as *const T), f)
}
@ -2153,14 +2153,14 @@ impl<T: ?Sized + Debug> Debug for RefCell<T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'b, T: ?Sized + Debug> Debug for Ref<'b, T> {
impl<T: ?Sized + Debug> Debug for Ref<'_, T> {
fn fmt(&self, f: &mut Formatter) -> Result {
Debug::fmt(&**self, f)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'b, T: ?Sized + Debug> Debug for RefMut<'b, T> {
impl<T: ?Sized + Debug> Debug for RefMut<'_, T> {
fn fmt(&self, f: &mut Formatter) -> Result {
Debug::fmt(&*(self.deref()), f)
}

View file

@ -361,7 +361,7 @@ pub trait Hasher {
}
#[stable(feature = "indirect_hasher_impl", since = "1.22.0")]
impl<'a, H: Hasher + ?Sized> Hasher for &'a mut H {
impl<H: Hasher + ?Sized> Hasher for &mut H {
fn finish(&self) -> u64 {
(**self).finish()
}
@ -669,14 +669,14 @@ mod impls {
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized + Hash> Hash for &'a T {
impl<T: ?Sized + Hash> Hash for &T {
fn hash<H: Hasher>(&self, state: &mut H) {
(**self).hash(state);
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized + Hash> Hash for &'a mut T {
impl<T: ?Sized + Hash> Hash for &mut T {
fn hash<H: Hasher>(&self, state: &mut H) {
(**self).hash(state);
}

View file

@ -2557,7 +2557,7 @@ fn select_fold1<I, B, FProj, FCmp>(mut it: I,
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, I: Iterator + ?Sized> Iterator for &'a mut I {
impl<I: Iterator + ?Sized> Iterator for &mut I {
type Item = I::Item;
fn next(&mut self) -> Option<I::Item> { (**self).next() }
fn size_hint(&self) -> (usize, Option<usize>) { (**self).size_hint() }

View file

@ -724,7 +724,7 @@ pub trait ExactSizeIterator: Iterator {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, I: ExactSizeIterator + ?Sized> ExactSizeIterator for &'a mut I {
impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for &mut I {
fn len(&self) -> usize {
(**self).len()
}
@ -974,7 +974,7 @@ impl<T, U, E> Product<Result<U, E>> for Result<T, E>
pub trait FusedIterator: Iterator {}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, I: FusedIterator + ?Sized> FusedIterator for &'a mut I {}
impl<I: FusedIterator + ?Sized> FusedIterator for &mut I {}
/// An iterator that reports an accurate length using size_hint.
///
@ -999,4 +999,4 @@ impl<'a, I: FusedIterator + ?Sized> FusedIterator for &'a mut I {}
pub unsafe trait TrustedLen : Iterator {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, I: TrustedLen + ?Sized> TrustedLen for &'a mut I {}
unsafe impl<I: TrustedLen + ?Sized> TrustedLen for &mut I {}

View file

@ -87,6 +87,7 @@
#![feature(doc_spotlight)]
#![feature(extern_types)]
#![feature(fundamental)]
#![feature(impl_header_lifetime_elision)]
#![feature(intrinsics)]
#![feature(lang_items)]
#![feature(link_llvm_intrinsics)]

View file

@ -584,9 +584,9 @@ impls! { PhantomData }
mod impls {
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<'a, T: Sync + ?Sized> Send for &'a T {}
unsafe impl<T: Sync + ?Sized> Send for &T {}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<'a, T: Send + ?Sized> Send for &'a mut T {}
unsafe impl<T: Send + ?Sized> Send for &mut T {}
}
/// Compiler-internal trait used to determine whether a type contains
@ -600,8 +600,8 @@ impl<T: ?Sized> !Freeze for UnsafeCell<T> {}
unsafe impl<T: ?Sized> Freeze for PhantomData<T> {}
unsafe impl<T: ?Sized> Freeze for *const T {}
unsafe impl<T: ?Sized> Freeze for *mut T {}
unsafe impl<'a, T: ?Sized> Freeze for &'a T {}
unsafe impl<'a, T: ?Sized> Freeze for &'a mut T {}
unsafe impl<T: ?Sized> Freeze for &T {}
unsafe impl<T: ?Sized> Freeze for &mut T {}
/// Types which can be safely moved after being pinned.
///
@ -689,6 +689,6 @@ mod copy_impls {
// Shared references can be copied, but mutable references *cannot*!
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Copy for &'a T {}
impl<T: ?Sized> Copy for &T {}
}

View file

@ -83,14 +83,14 @@ pub trait Deref {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Deref for &'a T {
impl<T: ?Sized> Deref for &T {
type Target = T;
fn deref(&self) -> &T { *self }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Deref for &'a mut T {
impl<T: ?Sized> Deref for &mut T {
type Target = T;
fn deref(&self) -> &T { *self }
@ -174,6 +174,6 @@ pub trait DerefMut: Deref {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> DerefMut for &'a mut T {
impl<T: ?Sized> DerefMut for &mut T {
fn deref_mut(&mut self) -> &mut T { *self }
}

View file

@ -240,7 +240,7 @@ pub trait FnOnce<Args> {
mod impls {
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a,A,F:?Sized> Fn<A> for &'a F
impl<A,F:?Sized> Fn<A> for &F
where F : Fn<A>
{
extern "rust-call" fn call(&self, args: A) -> F::Output {
@ -249,7 +249,7 @@ mod impls {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a,A,F:?Sized> FnMut<A> for &'a F
impl<A,F:?Sized> FnMut<A> for &F
where F : Fn<A>
{
extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output {
@ -258,7 +258,7 @@ mod impls {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a,A,F:?Sized> FnOnce<A> for &'a F
impl<A,F:?Sized> FnOnce<A> for &F
where F : Fn<A>
{
type Output = F::Output;
@ -269,7 +269,7 @@ mod impls {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a,A,F:?Sized> FnMut<A> for &'a mut F
impl<A,F:?Sized> FnMut<A> for &mut F
where F : FnMut<A>
{
extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output {
@ -278,7 +278,7 @@ mod impls {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a,A,F:?Sized> FnOnce<A> for &'a mut F
impl<A,F:?Sized> FnOnce<A> for &mut F
where F : FnMut<A>
{
type Output = F::Output;

View file

@ -124,7 +124,7 @@ pub trait Generator {
}
#[unstable(feature = "generator_trait", issue = "43122")]
impl<'a, T> Generator for &'a mut T
impl<T> Generator for &mut T
where T: Generator + ?Sized
{
type Yield = T::Yield;

View file

@ -851,7 +851,7 @@ impl<'a, T: ?Sized + 'a> RangeBounds<T> for (Bound<&'a T>, Bound<&'a T>) {
}
#[stable(feature = "collections_range", since = "1.28.0")]
impl<'a, T> RangeBounds<T> for RangeFrom<&'a T> {
impl<T> RangeBounds<T> for RangeFrom<&T> {
fn start_bound(&self) -> Bound<&T> {
Included(self.start)
}
@ -861,7 +861,7 @@ impl<'a, T> RangeBounds<T> for RangeFrom<&'a T> {
}
#[stable(feature = "collections_range", since = "1.28.0")]
impl<'a, T> RangeBounds<T> for RangeTo<&'a T> {
impl<T> RangeBounds<T> for RangeTo<&T> {
fn start_bound(&self) -> Bound<&T> {
Unbounded
}
@ -871,7 +871,7 @@ impl<'a, T> RangeBounds<T> for RangeTo<&'a T> {
}
#[stable(feature = "collections_range", since = "1.28.0")]
impl<'a, T> RangeBounds<T> for Range<&'a T> {
impl<T> RangeBounds<T> for Range<&T> {
fn start_bound(&self) -> Bound<&T> {
Included(self.start)
}
@ -881,7 +881,7 @@ impl<'a, T> RangeBounds<T> for Range<&'a T> {
}
#[stable(feature = "collections_range", since = "1.28.0")]
impl<'a, T> RangeBounds<T> for RangeInclusive<&'a T> {
impl<T> RangeBounds<T> for RangeInclusive<&T> {
fn start_bound(&self) -> Bound<&T> {
Included(self.start)
}
@ -891,7 +891,7 @@ impl<'a, T> RangeBounds<T> for RangeInclusive<&'a T> {
}
#[stable(feature = "collections_range", since = "1.28.0")]
impl<'a, T> RangeBounds<T> for RangeToInclusive<&'a T> {
impl<T> RangeBounds<T> for RangeToInclusive<&T> {
fn start_bound(&self) -> Bound<&T> {
Unbounded
}

View file

@ -1153,18 +1153,18 @@ impl<'a, A> DoubleEndedIterator for Iter<'a, A> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, A> ExactSizeIterator for Iter<'a, A> {}
impl<A> ExactSizeIterator for Iter<'_, A> {}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, A> FusedIterator for Iter<'a, A> {}
impl<A> FusedIterator for Iter<'_, A> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, A> TrustedLen for Iter<'a, A> {}
unsafe impl<A> TrustedLen for Iter<'_, A> {}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, A> Clone for Iter<'a, A> {
impl<A> Clone for Iter<'_, A> {
#[inline]
fn clone(&self) -> Iter<'a, A> {
fn clone(&self) -> Self {
Iter { inner: self.inner.clone() }
}
}
@ -1199,12 +1199,12 @@ impl<'a, A> DoubleEndedIterator for IterMut<'a, A> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, A> ExactSizeIterator for IterMut<'a, A> {}
impl<A> ExactSizeIterator for IterMut<'_, A> {}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, A> FusedIterator for IterMut<'a, A> {}
impl<A> FusedIterator for IterMut<'_, A> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, A> TrustedLen for IterMut<'a, A> {}
unsafe impl<A> TrustedLen for IterMut<'_, A> {}
/// An iterator over the value in [`Some`] variant of an [`Option`].
///

View file

@ -133,7 +133,7 @@ impl<'a> PanicInfo<'a> {
}
#[stable(feature = "panic_hook_display", since = "1.26.0")]
impl<'a> fmt::Display for PanicInfo<'a> {
impl fmt::Display for PanicInfo<'_> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("panicked at ")?;
if let Some(message) = self.message {
@ -258,7 +258,7 @@ impl<'a> Location<'a> {
}
#[stable(feature = "panic_hook_display", since = "1.26.0")]
impl<'a> fmt::Display for Location<'a> {
impl fmt::Display for Location<'_> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "{}:{}:{}", self.file, self.line, self.col)
}

View file

@ -1098,18 +1098,18 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> ExactSizeIterator for Iter<'a, T> {}
impl<T> ExactSizeIterator for Iter<'_, T> {}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, T> FusedIterator for Iter<'a, T> {}
impl<T> FusedIterator for Iter<'_, T> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, A> TrustedLen for Iter<'a, A> {}
unsafe impl<A> TrustedLen for Iter<'_, A> {}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> Clone for Iter<'a, T> {
impl<T> Clone for Iter<'_, T> {
#[inline]
fn clone(&self) -> Iter<'a, T> { Iter { inner: self.inner } }
fn clone(&self) -> Self { Iter { inner: self.inner } }
}
/// An iterator over a mutable reference to the [`Ok`] variant of a [`Result`].
@ -1143,13 +1143,13 @@ impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> ExactSizeIterator for IterMut<'a, T> {}
impl<T> ExactSizeIterator for IterMut<'_, T> {}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, T> FusedIterator for IterMut<'a, T> {}
impl<T> FusedIterator for IterMut<'_, T> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, A> TrustedLen for IterMut<'a, A> {}
unsafe impl<A> TrustedLen for IterMut<'_, A> {}
/// An iterator over the value in a [`Ok`] variant of a [`Result`].
///

View file

@ -2528,15 +2528,15 @@ impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
////////////////////////////////////////////////////////////////////////////////
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> Default for &'a [T] {
impl<T> Default for &[T] {
/// Creates an empty slice.
fn default() -> &'a [T] { &[] }
fn default() -> Self { &[] }
}
#[stable(feature = "mut_slice_default", since = "1.5.0")]
impl<'a, T> Default for &'a mut [T] {
impl<T> Default for &mut [T] {
/// Creates a mutable empty slice.
fn default() -> &'a mut [T] { &mut [] }
fn default() -> Self { &mut [] }
}
//
@ -2863,7 +2863,7 @@ pub struct Iter<'a, T: 'a> {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Iter")
.field(&self.as_slice())
@ -2872,9 +2872,9 @@ impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<'a, T: Sync> Sync for Iter<'a, T> {}
unsafe impl<T: Sync> Sync for Iter<'_, T> {}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<'a, T: Sync> Send for Iter<'a, T> {}
unsafe impl<T: Sync> Send for Iter<'_, T> {}
impl<'a, T> Iter<'a, T> {
/// View the underlying data as a subslice of the original data.
@ -2910,12 +2910,12 @@ impl<'a, T> Iter<'a, T> {
iterator!{struct Iter -> *const T, &'a T, const, /* no mut */}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> Clone for Iter<'a, T> {
fn clone(&self) -> Iter<'a, T> { Iter { ptr: self.ptr, end: self.end, _marker: self._marker } }
impl<T> Clone for Iter<'_, T> {
fn clone(&self) -> Self { Iter { ptr: self.ptr, end: self.end, _marker: self._marker } }
}
#[stable(feature = "slice_iter_as_ref", since = "1.13.0")]
impl<'a, T> AsRef<[T]> for Iter<'a, T> {
impl<T> AsRef<[T]> for Iter<'_, T> {
fn as_ref(&self) -> &[T] {
self.as_slice()
}
@ -2955,7 +2955,7 @@ pub struct IterMut<'a, T: 'a> {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("IterMut")
.field(&self.make_slice())
@ -2964,9 +2964,9 @@ impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<'a, T: Sync> Sync for IterMut<'a, T> {}
unsafe impl<T: Sync> Sync for IterMut<'_, T> {}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<'a, T: Send> Send for IterMut<'a, T> {}
unsafe impl<T: Send> Send for IterMut<'_, T> {}
impl<'a, T> IterMut<'a, T> {
/// View the underlying data as a subslice of the original data.
@ -3034,7 +3034,7 @@ pub struct Split<'a, T:'a, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for Split<'a, T, P> where P: FnMut(&T) -> bool {
impl<T: fmt::Debug, P> fmt::Debug for Split<'_, T, P> where P: FnMut(&T) -> bool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Split")
.field("v", &self.v)
@ -3045,8 +3045,8 @@ impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for Split<'a, T, P> where P: FnMut(&T
// FIXME(#26925) Remove in favor of `#[derive(Clone)]`
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T, P> Clone for Split<'a, T, P> where P: Clone + FnMut(&T) -> bool {
fn clone(&self) -> Split<'a, T, P> {
impl<T, P> Clone for Split<'_, T, P> where P: Clone + FnMut(&T) -> bool {
fn clone(&self) -> Self {
Split {
v: self.v,
pred: self.pred.clone(),
@ -3108,7 +3108,7 @@ impl<'a, T, P> SplitIter for Split<'a, T, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, T, P> FusedIterator for Split<'a, T, P> where P: FnMut(&T) -> bool {}
impl<T, P> FusedIterator for Split<'_, T, P> where P: FnMut(&T) -> bool {}
/// An iterator over the subslices of the vector which are separated
/// by elements that match `pred`.
@ -3125,7 +3125,7 @@ pub struct SplitMut<'a, T:'a, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for SplitMut<'a, T, P> where P: FnMut(&T) -> bool {
impl<T: fmt::Debug, P> fmt::Debug for SplitMut<'_, T, P> where P: FnMut(&T) -> bool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("SplitMut")
.field("v", &self.v)
@ -3206,7 +3206,7 @@ impl<'a, T, P> DoubleEndedIterator for SplitMut<'a, T, P> where
}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, T, P> FusedIterator for SplitMut<'a, T, P> where P: FnMut(&T) -> bool {}
impl<T, P> FusedIterator for SplitMut<'_, T, P> where P: FnMut(&T) -> bool {}
/// An iterator over subslices separated by elements that match a predicate
/// function, starting from the end of the slice.
@ -3222,7 +3222,7 @@ pub struct RSplit<'a, T:'a, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "slice_rsplit", since = "1.27.0")]
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
impl<T: fmt::Debug, P> fmt::Debug for RSplit<'_, T, P> where P: FnMut(&T) -> bool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("RSplit")
.field("v", &self.inner.v)
@ -3263,7 +3263,7 @@ impl<'a, T, P> SplitIter for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "slice_rsplit", since = "1.27.0")]
impl<'a, T, P> FusedIterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {}
impl<T, P> FusedIterator for RSplit<'_, T, P> where P: FnMut(&T) -> bool {}
/// An iterator over the subslices of the vector which are separated
/// by elements that match `pred`, starting from the end of the slice.
@ -3278,7 +3278,7 @@ pub struct RSplitMut<'a, T:'a, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "slice_rsplit", since = "1.27.0")]
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
impl<T: fmt::Debug, P> fmt::Debug for RSplitMut<'_, T, P> where P: FnMut(&T) -> bool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("RSplitMut")
.field("v", &self.inner.v)
@ -3321,7 +3321,7 @@ impl<'a, T, P> DoubleEndedIterator for RSplitMut<'a, T, P> where
}
#[stable(feature = "slice_rsplit", since = "1.27.0")]
impl<'a, T, P> FusedIterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {}
impl<T, P> FusedIterator for RSplitMut<'_, T, P> where P: FnMut(&T) -> bool {}
/// An private iterator over subslices separated by elements that
/// match a predicate function, splitting at most a fixed number of
@ -3364,7 +3364,7 @@ pub struct SplitN<'a, T: 'a, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for SplitN<'a, T, P> where P: FnMut(&T) -> bool {
impl<T: fmt::Debug, P> fmt::Debug for SplitN<'_, T, P> where P: FnMut(&T) -> bool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("SplitN")
.field("inner", &self.inner)
@ -3386,7 +3386,7 @@ pub struct RSplitN<'a, T: 'a, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitN<'a, T, P> where P: FnMut(&T) -> bool {
impl<T: fmt::Debug, P> fmt::Debug for RSplitN<'_, T, P> where P: FnMut(&T) -> bool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("RSplitN")
.field("inner", &self.inner)
@ -3407,7 +3407,7 @@ pub struct SplitNMut<'a, T: 'a, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for SplitNMut<'a, T, P> where P: FnMut(&T) -> bool {
impl<T: fmt::Debug, P> fmt::Debug for SplitNMut<'_, T, P> where P: FnMut(&T) -> bool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("SplitNMut")
.field("inner", &self.inner)
@ -3429,7 +3429,7 @@ pub struct RSplitNMut<'a, T: 'a, P> where P: FnMut(&T) -> bool {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitNMut<'a, T, P> where P: FnMut(&T) -> bool {
impl<T: fmt::Debug, P> fmt::Debug for RSplitNMut<'_, T, P> where P: FnMut(&T) -> bool {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("RSplitNMut")
.field("inner", &self.inner)
@ -3482,8 +3482,8 @@ pub struct Windows<'a, T:'a> {
// FIXME(#26925) Remove in favor of `#[derive(Clone)]`
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> Clone for Windows<'a, T> {
fn clone(&self) -> Windows<'a, T> {
impl<T> Clone for Windows<'_, T> {
fn clone(&self) -> Self {
Windows {
v: self.v,
size: self.size,
@ -3560,13 +3560,13 @@ impl<'a, T> DoubleEndedIterator for Windows<'a, T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> ExactSizeIterator for Windows<'a, T> {}
impl<T> ExactSizeIterator for Windows<'_, T> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, T> TrustedLen for Windows<'a, T> {}
unsafe impl<T> TrustedLen for Windows<'_, T> {}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, T> FusedIterator for Windows<'a, T> {}
impl<T> FusedIterator for Windows<'_, T> {}
#[doc(hidden)]
unsafe impl<'a, T> TrustedRandomAccess for Windows<'a, T> {
@ -3595,8 +3595,8 @@ pub struct Chunks<'a, T:'a> {
// FIXME(#26925) Remove in favor of `#[derive(Clone)]`
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> Clone for Chunks<'a, T> {
fn clone(&self) -> Chunks<'a, T> {
impl<T> Clone for Chunks<'_, T> {
fn clone(&self) -> Self {
Chunks {
v: self.v,
chunk_size: self.chunk_size,
@ -3682,13 +3682,13 @@ impl<'a, T> DoubleEndedIterator for Chunks<'a, T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> ExactSizeIterator for Chunks<'a, T> {}
impl<T> ExactSizeIterator for Chunks<'_, T> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, T> TrustedLen for Chunks<'a, T> {}
unsafe impl<T> TrustedLen for Chunks<'_, T> {}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, T> FusedIterator for Chunks<'a, T> {}
impl<T> FusedIterator for Chunks<'_, T> {}
#[doc(hidden)]
unsafe impl<'a, T> TrustedRandomAccess for Chunks<'a, T> {
@ -3801,13 +3801,13 @@ impl<'a, T> DoubleEndedIterator for ChunksMut<'a, T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> ExactSizeIterator for ChunksMut<'a, T> {}
impl<T> ExactSizeIterator for ChunksMut<'_, T> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, T> TrustedLen for ChunksMut<'a, T> {}
unsafe impl<T> TrustedLen for ChunksMut<'_, T> {}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, T> FusedIterator for ChunksMut<'a, T> {}
impl<T> FusedIterator for ChunksMut<'_, T> {}
#[doc(hidden)]
unsafe impl<'a, T> TrustedRandomAccess for ChunksMut<'a, T> {
@ -3854,8 +3854,8 @@ impl<'a, T> ChunksExact<'a, T> {
// FIXME(#26925) Remove in favor of `#[derive(Clone)]`
#[unstable(feature = "chunks_exact", issue = "47115")]
impl<'a, T> Clone for ChunksExact<'a, T> {
fn clone(&self) -> ChunksExact<'a, T> {
impl<T> Clone for ChunksExact<'_, T> {
fn clone(&self) -> Self {
ChunksExact {
v: self.v,
rem: self.rem,
@ -3924,17 +3924,17 @@ impl<'a, T> DoubleEndedIterator for ChunksExact<'a, T> {
}
#[unstable(feature = "chunks_exact", issue = "47115")]
impl<'a, T> ExactSizeIterator for ChunksExact<'a, T> {
impl<T> ExactSizeIterator for ChunksExact<'_, T> {
fn is_empty(&self) -> bool {
self.v.is_empty()
}
}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, T> TrustedLen for ChunksExact<'a, T> {}
unsafe impl<T> TrustedLen for ChunksExact<'_, T> {}
#[unstable(feature = "chunks_exact", issue = "47115")]
impl<'a, T> FusedIterator for ChunksExact<'a, T> {}
impl<T> FusedIterator for ChunksExact<'_, T> {}
#[doc(hidden)]
unsafe impl<'a, T> TrustedRandomAccess for ChunksExact<'a, T> {
@ -4039,17 +4039,17 @@ impl<'a, T> DoubleEndedIterator for ChunksExactMut<'a, T> {
}
#[unstable(feature = "chunks_exact", issue = "47115")]
impl<'a, T> ExactSizeIterator for ChunksExactMut<'a, T> {
impl<T> ExactSizeIterator for ChunksExactMut<'_, T> {
fn is_empty(&self) -> bool {
self.v.is_empty()
}
}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, T> TrustedLen for ChunksExactMut<'a, T> {}
unsafe impl<T> TrustedLen for ChunksExactMut<'_, T> {}
#[unstable(feature = "chunks_exact", issue = "47115")]
impl<'a, T> FusedIterator for ChunksExactMut<'a, T> {}
impl<T> FusedIterator for ChunksExactMut<'_, T> {}
#[doc(hidden)]
unsafe impl<'a, T> TrustedRandomAccess for ChunksExactMut<'a, T> {

View file

@ -617,7 +617,7 @@ impl<'a> DoubleEndedIterator for Chars<'a> {
}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for Chars<'a> {}
impl FusedIterator for Chars<'_> {}
impl<'a> Chars<'a> {
/// View the underlying data as a subslice of the original data.
@ -707,7 +707,7 @@ impl<'a> DoubleEndedIterator for CharIndices<'a> {
}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for CharIndices<'a> {}
impl FusedIterator for CharIndices<'_> {}
impl<'a> CharIndices<'a> {
/// View the underlying data as a subslice of the original data.
@ -733,7 +733,7 @@ impl<'a> CharIndices<'a> {
pub struct Bytes<'a>(Cloned<slice::Iter<'a, u8>>);
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> Iterator for Bytes<'a> {
impl Iterator for Bytes<'_> {
type Item = u8;
#[inline]
@ -794,7 +794,7 @@ impl<'a> Iterator for Bytes<'a> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> DoubleEndedIterator for Bytes<'a> {
impl DoubleEndedIterator for Bytes<'_> {
#[inline]
fn next_back(&mut self) -> Option<u8> {
self.0.next_back()
@ -809,7 +809,7 @@ impl<'a> DoubleEndedIterator for Bytes<'a> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> ExactSizeIterator for Bytes<'a> {
impl ExactSizeIterator for Bytes<'_> {
#[inline]
fn len(&self) -> usize {
self.0.len()
@ -822,10 +822,10 @@ impl<'a> ExactSizeIterator for Bytes<'a> {
}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for Bytes<'a> {}
impl FusedIterator for Bytes<'_> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a> TrustedLen for Bytes<'a> {}
unsafe impl TrustedLen for Bytes<'_> {}
#[doc(hidden)]
unsafe impl<'a> TrustedRandomAccess for Bytes<'a> {
@ -1342,7 +1342,7 @@ impl<'a> DoubleEndedIterator for Lines<'a> {
}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for Lines<'a> {}
impl FusedIterator for Lines<'_> {}
/// Created with the method [`lines_any`].
///
@ -1409,7 +1409,7 @@ impl<'a> DoubleEndedIterator for LinesAny<'a> {
#[stable(feature = "fused", since = "1.26.0")]
#[allow(deprecated)]
impl<'a> FusedIterator for LinesAny<'a> {}
impl FusedIterator for LinesAny<'_> {}
/*
Section: UTF-8 validation
@ -4033,15 +4033,15 @@ impl AsRef<[u8]> for str {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> Default for &'a str {
impl Default for &str {
/// Creates an empty str
fn default() -> &'a str { "" }
fn default() -> Self { "" }
}
#[stable(feature = "default_mut_str", since = "1.28.0")]
impl<'a> Default for &'a mut str {
impl Default for &mut str {
/// Creates an empty mutable str
fn default() -> &'a mut str { unsafe { from_utf8_unchecked_mut(&mut []) } }
fn default() -> Self { unsafe { from_utf8_unchecked_mut(&mut []) } }
}
/// An iterator over the non-whitespace substrings of a string,
@ -4189,7 +4189,7 @@ impl<'a> DoubleEndedIterator for SplitWhitespace<'a> {
}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for SplitWhitespace<'a> {}
impl FusedIterator for SplitWhitespace<'_> {}
#[unstable(feature = "split_ascii_whitespace", issue = "48656")]
impl<'a> Iterator for SplitAsciiWhitespace<'a> {
@ -4215,7 +4215,7 @@ impl<'a> DoubleEndedIterator for SplitAsciiWhitespace<'a> {
}
#[unstable(feature = "split_ascii_whitespace", issue = "48656")]
impl<'a> FusedIterator for SplitAsciiWhitespace<'a> {}
impl FusedIterator for SplitAsciiWhitespace<'_> {}
/// An iterator of [`u16`] over the string encoded as UTF-16.
///
@ -4234,7 +4234,7 @@ pub struct EncodeUtf16<'a> {
}
#[stable(feature = "collection_debug", since = "1.17.0")]
impl<'a> fmt::Debug for EncodeUtf16<'a> {
impl fmt::Debug for EncodeUtf16<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.pad("EncodeUtf16 { .. }")
}
@ -4273,4 +4273,4 @@ impl<'a> Iterator for EncodeUtf16<'a> {
}
#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for EncodeUtf16<'a> {}
impl FusedIterator for EncodeUtf16<'_> {}

View file

@ -491,7 +491,7 @@ impl<F> MultiCharEq for F where F: FnMut(char) -> bool {
fn matches(&mut self, c: char) -> bool { (*self)(c) }
}
impl<'a> MultiCharEq for &'a [char] {
impl MultiCharEq for &[char] {
#[inline]
fn matches(&mut self, c: char) -> bool {
self.iter().any(|&m| { m == c })
@ -666,7 +666,7 @@ impl<'a, 'b> Pattern<'a> for &'b [char] {
pub struct CharPredicateSearcher<'a, F>(<MultiCharEqPattern<F> as Pattern<'a>>::Searcher)
where F: FnMut(char) -> bool;
impl<'a, F> fmt::Debug for CharPredicateSearcher<'a, F>
impl<F> fmt::Debug for CharPredicateSearcher<'_, F>
where F: FnMut(char) -> bool
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

View file

@ -229,7 +229,7 @@ fn test_iterator_step_by_nth_overflow() {
#[derive(Clone)]
struct Test(Bigger);
impl<'a> Iterator for &'a mut Test {
impl Iterator for &mut Test {
type Item = i32;
fn next(&mut self) -> Option<Self::Item> { Some(21) }
fn nth(&mut self, n: usize) -> Option<Self::Item> {