mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
Rollup merge of #54687 - scottmcm:more-elision, r=dtolnay
Use impl_header_lifetime_elision in libcore The feature is approved for stabilization, so let's use it to remove about 300 `'a`s. Tracking issue for the feature: https://github.com/rust-lang/rust/issues/15872
This commit is contained in:
@@ -226,16 +226,16 @@ fn borrow_mut(&mut self) -> &mut T { self }
|
||||
}
|
||||
|
||||
#[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 }
|
||||
}
|
||||
|
||||
+9
-9
@@ -1092,7 +1092,7 @@ fn new(borrow: &'b Cell<BorrowFlag>) -> Option<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 @@ fn drop(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ pub fn map_split<U: ?Sized, V: ?Sized, F>(orig: Ref<'b, T>, f: F) -> (Ref<'b, U>
|
||||
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 @@ fn deref(&self) -> &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 @@ fn deref_mut(&mut self) -> &mut 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)
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ fn clone(&self) -> Self {
|
||||
|
||||
// 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
|
||||
|
||||
+6
-6
@@ -1033,12 +1033,12 @@ fn ge(&self, other: & &'b B) -> bool { PartialOrd::ge(*self, *other) }
|
||||
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 @@ fn ge(&self, other: &&'b mut B) -> bool { PartialOrd::ge(*self, *other) }
|
||||
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> {
|
||||
|
||||
@@ -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 @@ fn as_ref(&self) -> &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 @@ fn as_ref(&self) -> &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()
|
||||
|
||||
@@ -28,7 +28,7 @@ fn wrap<'b, 'c: 'a+'b>(fmt: &'c mut fmt::Formatter, slot: &'b mut Option<Self>)
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
+13
-13
@@ -208,7 +208,7 @@ fn write_fmt(&mut self, args: Arguments) -> Result {
|
||||
// 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 @@ fn write_fmt(&mut self, args: Arguments) -> Result {
|
||||
}
|
||||
|
||||
#[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 @@ pub fn debug_map<'b>(&'b mut self) -> DebugMap<'b, '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 @@ fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
}
|
||||
|
||||
#[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 @@ fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
}
|
||||
|
||||
#[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)
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ fn write_isize(&mut self, i: isize) {
|
||||
}
|
||||
|
||||
#[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 @@ fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
|
||||
|
||||
#[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);
|
||||
}
|
||||
|
||||
@@ -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() }
|
||||
|
||||
@@ -724,7 +724,7 @@ fn is_empty(&self) -> bool {
|
||||
}
|
||||
|
||||
#[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 @@ fn product<I>(iter: I) -> 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 {}
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -584,9 +584,9 @@ fn default() -> $t<T> {
|
||||
|
||||
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 @@ impl<T: ?Sized> Copy for *mut T {}
|
||||
|
||||
// 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 {}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
|
||||
@@ -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 @@ extern "rust-call" fn call(&self, args: A) -> F::Output {
|
||||
}
|
||||
|
||||
#[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 @@ extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output {
|
||||
}
|
||||
|
||||
#[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 @@ extern "rust-call" fn call_once(self, args: A) -> F::Output {
|
||||
}
|
||||
|
||||
#[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 @@ extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output {
|
||||
}
|
||||
|
||||
#[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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -851,7 +851,7 @@ fn end_bound(&self) -> Bound<&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 @@ fn end_bound(&self) -> Bound<&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 @@ fn end_bound(&self) -> Bound<&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 @@ fn end_bound(&self) -> Bound<&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 @@ fn end_bound(&self) -> Bound<&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
|
||||
}
|
||||
|
||||
@@ -1153,18 +1153,18 @@ fn next_back(&mut self) -> Option<&'a A> { self.inner.next_back() }
|
||||
}
|
||||
|
||||
#[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 @@ fn next_back(&mut self) -> Option<&'a mut A> { self.inner.next_back() }
|
||||
}
|
||||
|
||||
#[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`].
|
||||
///
|
||||
|
||||
@@ -133,7 +133,7 @@ pub fn location(&self) -> Option<&Location> {
|
||||
}
|
||||
|
||||
#[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 @@ pub fn column(&self) -> u32 {
|
||||
}
|
||||
|
||||
#[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)
|
||||
}
|
||||
|
||||
@@ -1098,18 +1098,18 @@ fn next_back(&mut self) -> Option<&'a T> { self.inner.take() }
|
||||
}
|
||||
|
||||
#[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 @@ fn next_back(&mut self) -> Option<&'a mut T> { self.inner.take() }
|
||||
}
|
||||
|
||||
#[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`].
|
||||
///
|
||||
|
||||
+48
-48
@@ -2529,15 +2529,15 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[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 [] }
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2864,7 +2864,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())
|
||||
@@ -2873,9 +2873,9 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
}
|
||||
|
||||
#[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.
|
||||
@@ -2911,12 +2911,12 @@ pub fn as_slice(&self) -> &'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()
|
||||
}
|
||||
@@ -2956,7 +2956,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())
|
||||
@@ -2965,9 +2965,9 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
}
|
||||
|
||||
#[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.
|
||||
@@ -3035,7 +3035,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)
|
||||
@@ -3046,8 +3046,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
|
||||
// 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(),
|
||||
@@ -3109,7 +3109,7 @@ fn finish(&mut self) -> Option<&'a [T]> {
|
||||
}
|
||||
|
||||
#[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`.
|
||||
@@ -3126,7 +3126,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)
|
||||
@@ -3207,7 +3207,7 @@ fn next_back(&mut self) -> Option<&'a mut [T]> {
|
||||
}
|
||||
|
||||
#[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.
|
||||
@@ -3223,7 +3223,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)
|
||||
@@ -3264,7 +3264,7 @@ fn finish(&mut self) -> Option<&'a [T]> {
|
||||
}
|
||||
|
||||
#[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.
|
||||
@@ -3279,7 +3279,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)
|
||||
@@ -3322,7 +3322,7 @@ fn next_back(&mut self) -> Option<&'a mut [T]> {
|
||||
}
|
||||
|
||||
#[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
|
||||
@@ -3365,7 +3365,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)
|
||||
@@ -3387,7 +3387,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)
|
||||
@@ -3408,7 +3408,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)
|
||||
@@ -3430,7 +3430,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)
|
||||
@@ -3483,8 +3483,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,
|
||||
@@ -3561,13 +3561,13 @@ fn next_back(&mut self) -> Option<&'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> {
|
||||
@@ -3596,8 +3596,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,
|
||||
@@ -3683,13 +3683,13 @@ fn next_back(&mut self) -> Option<&'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> {
|
||||
@@ -3802,13 +3802,13 @@ fn next_back(&mut self) -> Option<&'a mut [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> {
|
||||
@@ -3855,8 +3855,8 @@ pub fn remainder(&self) -> &'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,
|
||||
@@ -3925,17 +3925,17 @@ fn next_back(&mut self) -> Option<&'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> {
|
||||
@@ -4040,17 +4040,17 @@ fn next_back(&mut self) -> Option<&'a mut [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> {
|
||||
|
||||
+17
-17
@@ -617,7 +617,7 @@ fn next_back(&mut self) -> Option<char> {
|
||||
}
|
||||
|
||||
#[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 @@ fn next_back(&mut self) -> Option<(usize, char)> {
|
||||
}
|
||||
|
||||
#[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 @@ pub fn as_str(&self) -> &'a str {
|
||||
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 @@ fn rposition<P>(&mut self, predicate: P) -> Option<usize> where
|
||||
}
|
||||
|
||||
#[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 @@ fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item> where
|
||||
}
|
||||
|
||||
#[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 @@ fn is_empty(&self) -> bool {
|
||||
}
|
||||
|
||||
#[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 @@ fn next_back(&mut self) -> Option<&'a str> {
|
||||
}
|
||||
|
||||
#[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 @@ fn next_back(&mut self) -> Option<&'a str> {
|
||||
|
||||
#[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 @@ fn as_ref(&self) -> &[u8] {
|
||||
}
|
||||
|
||||
#[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 @@ fn next_back(&mut self) -> Option<&'a str> {
|
||||
}
|
||||
|
||||
#[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 @@ fn next_back(&mut self) -> Option<&'a str> {
|
||||
}
|
||||
|
||||
#[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 @@ fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
}
|
||||
|
||||
#[stable(feature = "fused", since = "1.26.0")]
|
||||
impl<'a> FusedIterator for EncodeUtf16<'a> {}
|
||||
impl FusedIterator for EncodeUtf16<'_> {}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#![feature(flt2dec)]
|
||||
#![feature(fmt_internals)]
|
||||
#![feature(hashmap_internals)]
|
||||
#![feature(impl_header_lifetime_elision)]
|
||||
#![feature(pattern)]
|
||||
#![feature(range_is_empty)]
|
||||
#![feature(raw)]
|
||||
|
||||
@@ -14,7 +14,7 @@ LL | impl Copy for &'static NotSync {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: conflicting implementation in crate `core`:
|
||||
- impl<'a, T> std::marker::Copy for &'a T
|
||||
- impl<'_, T> std::marker::Copy for &T
|
||||
where T: ?Sized;
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
|
||||
@@ -24,7 +24,7 @@ LL | impl Copy for &'static [NotSync] {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: conflicting implementation in crate `core`:
|
||||
- impl<'a, T> std::marker::Copy for &'a T
|
||||
- impl<'_, T> std::marker::Copy for &T
|
||||
where T: ?Sized;
|
||||
|
||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||
|
||||
@@ -5,7 +5,7 @@ LL | impl<Foo> Deref for Foo { } //~ ERROR must be used
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: conflicting implementation in crate `core`:
|
||||
- impl<'a, T> std::ops::Deref for &'a T
|
||||
- impl<'_, T> std::ops::Deref for &T
|
||||
where T: ?Sized;
|
||||
|
||||
error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g. `MyStruct<Foo>`)
|
||||
|
||||
Reference in New Issue
Block a user