Rollup merge of #110244 - kadiwa4:unnecessary_imports, r=JohnTitor

Remove some unneeded imports / qualified paths

Continuation of #105537.
This commit is contained in:
Matthias Krüger 2023-04-14 21:11:13 +02:00 committed by GitHub
commit d5c7237400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 64 additions and 135 deletions

View file

@ -1,5 +1,4 @@
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::iter::Iterator;
use std::ops::RangeBounds; use std::ops::RangeBounds;
use std::vec::Vec; use std::vec::Vec;

View file

@ -1,5 +1,5 @@
use rand::RngCore; use rand::RngCore;
use std::iter::{repeat, FromIterator}; use std::iter::repeat;
use test::{black_box, Bencher}; use test::{black_box, Bencher};
#[bench] #[bench]

View file

@ -150,16 +150,13 @@ use core::any::Any;
use core::async_iter::AsyncIterator; use core::async_iter::AsyncIterator;
use core::borrow; use core::borrow;
use core::cmp::Ordering; use core::cmp::Ordering;
use core::convert::{From, TryFrom};
use core::error::Error; use core::error::Error;
use core::fmt; use core::fmt;
use core::future::Future; use core::future::Future;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
#[cfg(not(no_global_oom_handling))] use core::iter::FusedIterator;
use core::iter::FromIterator;
use core::iter::{FusedIterator, Iterator};
use core::marker::Tuple; use core::marker::Tuple;
use core::marker::{Unpin, Unsize}; use core::marker::Unsize;
use core::mem; use core::mem;
use core::ops::{ use core::ops::{
CoerceUnsized, Deref, DerefMut, DispatchFromDyn, Generator, GeneratorState, Receiver, CoerceUnsized, Deref, DerefMut, DispatchFromDyn, Generator, GeneratorState, Receiver,

View file

@ -144,7 +144,7 @@
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]
use core::fmt; use core::fmt;
use core::iter::{FromIterator, FusedIterator, InPlaceIterable, SourceIter, TrustedLen}; use core::iter::{FusedIterator, InPlaceIterable, SourceIter, TrustedLen};
use core::mem::{self, swap, ManuallyDrop}; use core::mem::{self, swap, ManuallyDrop};
use core::num::NonZeroUsize; use core::num::NonZeroUsize;
use core::ops::{Deref, DerefMut}; use core::ops::{Deref, DerefMut};
@ -263,7 +263,6 @@ mod tests;
/// more detailed analysis. /// more detailed analysis.
/// ///
/// [`core::cmp::Reverse`]: core::cmp::Reverse /// [`core::cmp::Reverse`]: core::cmp::Reverse
/// [`Ord`]: core::cmp::Ord
/// [`Cell`]: core::cell::Cell /// [`Cell`]: core::cell::Cell
/// [`RefCell`]: core::cell::RefCell /// [`RefCell`]: core::cell::RefCell
/// [push]: BinaryHeap::push /// [push]: BinaryHeap::push
@ -1418,7 +1417,6 @@ impl<T> FusedIterator for Iter<'_, T> {}
/// (provided by the [`IntoIterator`] trait). See its documentation for more. /// (provided by the [`IntoIterator`] trait). See its documentation for more.
/// ///
/// [`into_iter`]: BinaryHeap::into_iter /// [`into_iter`]: BinaryHeap::into_iter
/// [`IntoIterator`]: core::iter::IntoIterator
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[derive(Clone)] #[derive(Clone)]
pub struct IntoIter<T> { pub struct IntoIter<T> {

View file

@ -3,7 +3,7 @@ use core::borrow::Borrow;
use core::cmp::Ordering; use core::cmp::Ordering;
use core::fmt::{self, Debug}; use core::fmt::{self, Debug};
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::iter::{FromIterator, FusedIterator}; use core::iter::FusedIterator;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::mem::{self, ManuallyDrop}; use core::mem::{self, ManuallyDrop};
use core::ops::{Bound, Index, RangeBounds}; use core::ops::{Bound, Index, RangeBounds};
@ -420,7 +420,6 @@ impl<'a, K: 'a, V: 'a> Default for IterMut<'a, K, V> {
/// (provided by the [`IntoIterator`] trait). See its documentation for more. /// (provided by the [`IntoIterator`] trait). See its documentation for more.
/// ///
/// [`into_iter`]: IntoIterator::into_iter /// [`into_iter`]: IntoIterator::into_iter
/// [`IntoIterator`]: core::iter::IntoIterator
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_insignificant_dtor] #[rustc_insignificant_dtor]
pub struct IntoIter< pub struct IntoIter<
@ -650,7 +649,7 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub fn clear(&mut self) { pub fn clear(&mut self) {
// avoid moving the allocator // avoid moving the allocator
mem::drop(BTreeMap { drop(BTreeMap {
root: mem::replace(&mut self.root, None), root: mem::replace(&mut self.root, None),
length: mem::replace(&mut self.length, 0), length: mem::replace(&mut self.length, 0),
alloc: self.alloc.clone(), alloc: self.alloc.clone(),

View file

@ -9,8 +9,7 @@ use crate::testing::ord_chaos::{Cyclic3, Governed, Governor};
use crate::testing::rng::DeterministicRng; use crate::testing::rng::DeterministicRng;
use crate::vec::Vec; use crate::vec::Vec;
use std::cmp::Ordering; use std::cmp::Ordering;
use std::convert::TryFrom; use std::iter;
use std::iter::{self, FromIterator};
use std::mem; use std::mem;
use std::ops::Bound::{self, Excluded, Included, Unbounded}; use std::ops::Bound::{self, Excluded, Included, Unbounded};
use std::ops::RangeBounds; use std::ops::RangeBounds;

View file

@ -4,7 +4,7 @@ use core::cmp::Ordering::{self, Equal, Greater, Less};
use core::cmp::{max, min}; use core::cmp::{max, min};
use core::fmt::{self, Debug}; use core::fmt::{self, Debug};
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::iter::{FromIterator, FusedIterator, Peekable}; use core::iter::{FusedIterator, Peekable};
use core::mem::ManuallyDrop; use core::mem::ManuallyDrop;
use core::ops::{BitAnd, BitOr, BitXor, RangeBounds, Sub}; use core::ops::{BitAnd, BitOr, BitXor, RangeBounds, Sub};
@ -30,7 +30,6 @@ use crate::alloc::{Allocator, Global};
/// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case /// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case
/// logarithmic and amortized constant time per item returned. /// logarithmic and amortized constant time per item returned.
/// ///
/// [`Ord`]: core::cmp::Ord
/// [`Cell`]: core::cell::Cell /// [`Cell`]: core::cell::Cell
/// [`RefCell`]: core::cell::RefCell /// [`RefCell`]: core::cell::RefCell
/// ///
@ -147,7 +146,6 @@ impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
/// (provided by the [`IntoIterator`] trait). See its documentation for more. /// (provided by the [`IntoIterator`] trait). See its documentation for more.
/// ///
/// [`into_iter`]: BTreeSet#method.into_iter /// [`into_iter`]: BTreeSet#method.into_iter
/// [`IntoIterator`]: core::iter::IntoIterator
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[derive(Debug)] #[derive(Debug)]
pub struct IntoIter< pub struct IntoIter<

View file

@ -4,7 +4,6 @@ use crate::testing::rng::DeterministicRng;
use crate::vec::Vec; use crate::vec::Vec;
use std::cmp::Ordering; use std::cmp::Ordering;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use std::iter::FromIterator;
use std::ops::Bound::{Excluded, Included}; use std::ops::Bound::{Excluded, Included};
use std::panic::{catch_unwind, AssertUnwindSafe}; use std::panic::{catch_unwind, AssertUnwindSafe};

View file

@ -15,7 +15,7 @@
use core::cmp::Ordering; use core::cmp::Ordering;
use core::fmt; use core::fmt;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::iter::{FromIterator, FusedIterator}; use core::iter::FusedIterator;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::mem; use core::mem;
use core::ptr::NonNull; use core::ptr::NonNull;
@ -130,7 +130,6 @@ impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> {
/// (provided by the [`IntoIterator`] trait). See its documentation for more. /// (provided by the [`IntoIterator`] trait). See its documentation for more.
/// ///
/// [`into_iter`]: LinkedList::into_iter /// [`into_iter`]: LinkedList::into_iter
/// [`IntoIterator`]: core::iter::IntoIterator
#[derive(Clone)] #[derive(Clone)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct IntoIter<T> { pub struct IntoIter<T> {

View file

@ -12,7 +12,6 @@ use super::VecDeque;
/// (provided by the [`IntoIterator`] trait). See its documentation for more. /// (provided by the [`IntoIterator`] trait). See its documentation for more.
/// ///
/// [`into_iter`]: VecDeque::into_iter /// [`into_iter`]: VecDeque::into_iter
/// [`IntoIterator`]: core::iter::IntoIterator
#[derive(Clone)] #[derive(Clone)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct IntoIter< pub struct IntoIter<

View file

@ -10,7 +10,7 @@
use core::cmp::{self, Ordering}; use core::cmp::{self, Ordering};
use core::fmt; use core::fmt;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::iter::{repeat_n, repeat_with, ByRefSized, FromIterator}; use core::iter::{repeat_n, repeat_with, ByRefSized};
use core::mem::{ManuallyDrop, SizedTypeProperties}; use core::mem::{ManuallyDrop, SizedTypeProperties};
use core::ops::{Index, IndexMut, Range, RangeBounds}; use core::ops::{Index, IndexMut, Range, RangeBounds};
use core::ptr; use core::ptr;

View file

@ -4,7 +4,6 @@ use core::alloc::LayoutError;
use core::cmp; use core::cmp;
use core::intrinsics; use core::intrinsics;
use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties}; use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties};
use core::ops::Drop;
use core::ptr::{self, NonNull, Unique}; use core::ptr::{self, NonNull, Unique};
use core::slice; use core::slice;

View file

@ -15,7 +15,7 @@
//! //!
//! [`Rc`] uses non-atomic reference counting. This means that overhead is very //! [`Rc`] uses non-atomic reference counting. This means that overhead is very
//! low, but an [`Rc`] cannot be sent between threads, and consequently [`Rc`] //! low, but an [`Rc`] cannot be sent between threads, and consequently [`Rc`]
//! does not implement [`Send`][send]. As a result, the Rust compiler //! does not implement [`Send`]. As a result, the Rust compiler
//! will check *at compile time* that you are not sending [`Rc`]s between //! will check *at compile time* that you are not sending [`Rc`]s between
//! threads. If you need multi-threaded, atomic reference counting, use //! threads. If you need multi-threaded, atomic reference counting, use
//! [`sync::Arc`][arc]. //! [`sync::Arc`][arc].
@ -232,7 +232,6 @@
//! [clone]: Clone::clone //! [clone]: Clone::clone
//! [`Cell`]: core::cell::Cell //! [`Cell`]: core::cell::Cell
//! [`RefCell`]: core::cell::RefCell //! [`RefCell`]: core::cell::RefCell
//! [send]: core::marker::Send
//! [arc]: crate::sync::Arc //! [arc]: crate::sync::Arc
//! [`Deref`]: core::ops::Deref //! [`Deref`]: core::ops::Deref
//! [downgrade]: Rc::downgrade //! [downgrade]: Rc::downgrade
@ -251,13 +250,12 @@ use core::any::Any;
use core::borrow; use core::borrow;
use core::cell::Cell; use core::cell::Cell;
use core::cmp::Ordering; use core::cmp::Ordering;
use core::convert::{From, TryFrom};
use core::fmt; use core::fmt;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::intrinsics::abort; use core::intrinsics::abort;
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
use core::iter; use core::iter;
use core::marker::{self, PhantomData, Unpin, Unsize}; use core::marker::{PhantomData, Unsize};
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
use core::mem::size_of_val; use core::mem::size_of_val;
use core::mem::{self, align_of_val_raw, forget}; use core::mem::{self, align_of_val_raw, forget};
@ -321,7 +319,7 @@ pub struct Rc<T: ?Sized> {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> !marker::Send for Rc<T> {} impl<T: ?Sized> !Send for Rc<T> {}
// Note that this negative impl isn't strictly necessary for correctness, // Note that this negative impl isn't strictly necessary for correctness,
// as `Rc` transitively contains a `Cell`, which is itself `!Sync`. // as `Rc` transitively contains a `Cell`, which is itself `!Sync`.
@ -329,7 +327,7 @@ impl<T: ?Sized> !marker::Send for Rc<T> {}
// having an explicit negative impl is nice for documentation purposes // having an explicit negative impl is nice for documentation purposes
// and results in nicer error messages. // and results in nicer error messages.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> !marker::Sync for Rc<T> {} impl<T: ?Sized> !Sync for Rc<T> {}
#[stable(feature = "catch_unwind", since = "1.9.0")] #[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Rc<T> {} impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Rc<T> {}
@ -1060,7 +1058,7 @@ impl<T: ?Sized> Rc<T> {
#[inline] #[inline]
#[stable(feature = "rc_mutate_strong_count", since = "1.53.0")] #[stable(feature = "rc_mutate_strong_count", since = "1.53.0")]
pub unsafe fn decrement_strong_count(ptr: *const T) { pub unsafe fn decrement_strong_count(ptr: *const T) {
unsafe { mem::drop(Rc::from_raw(ptr)) }; unsafe { drop(Rc::from_raw(ptr)) };
} }
/// Returns `true` if there are no other `Rc` or [`Weak`] pointers to /// Returns `true` if there are no other `Rc` or [`Weak`] pointers to
@ -1496,7 +1494,7 @@ impl<T> Rc<[T]> {
/// ///
/// Behavior is undefined should the size be wrong. /// Behavior is undefined should the size be wrong.
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
unsafe fn from_iter_exact(iter: impl iter::Iterator<Item = T>, len: usize) -> Rc<[T]> { unsafe fn from_iter_exact(iter: impl Iterator<Item = T>, len: usize) -> Rc<[T]> {
// Panic guard while cloning T elements. // Panic guard while cloning T elements.
// In the event of a panic, elements that have been written // In the event of a panic, elements that have been written
// into the new RcBox will be dropped, then the memory freed. // into the new RcBox will be dropped, then the memory freed.
@ -2088,7 +2086,7 @@ impl<T, const N: usize> TryFrom<Rc<[T]>> for Rc<[T; N]> {
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
#[stable(feature = "shared_from_iter", since = "1.37.0")] #[stable(feature = "shared_from_iter", since = "1.37.0")]
impl<T> iter::FromIterator<T> for Rc<[T]> { impl<T> FromIterator<T> for Rc<[T]> {
/// Takes each element in the `Iterator` and collects it into an `Rc<[T]>`. /// Takes each element in the `Iterator` and collects it into an `Rc<[T]>`.
/// ///
/// # Performance characteristics /// # Performance characteristics
@ -2127,7 +2125,7 @@ impl<T> iter::FromIterator<T> for Rc<[T]> {
/// let evens: Rc<[u8]> = (0..10).collect(); // Just a single allocation happens here. /// let evens: Rc<[u8]> = (0..10).collect(); // Just a single allocation happens here.
/// # assert_eq!(&*evens, &*(0..10).collect::<Vec<_>>()); /// # assert_eq!(&*evens, &*(0..10).collect::<Vec<_>>());
/// ``` /// ```
fn from_iter<I: iter::IntoIterator<Item = T>>(iter: I) -> Self { fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
ToRcSlice::to_rc_slice(iter.into_iter()) ToRcSlice::to_rc_slice(iter.into_iter())
} }
} }
@ -2204,9 +2202,9 @@ pub struct Weak<T: ?Sized> {
} }
#[stable(feature = "rc_weak", since = "1.4.0")] #[stable(feature = "rc_weak", since = "1.4.0")]
impl<T: ?Sized> !marker::Send for Weak<T> {} impl<T: ?Sized> !Send for Weak<T> {}
#[stable(feature = "rc_weak", since = "1.4.0")] #[stable(feature = "rc_weak", since = "1.4.0")]
impl<T: ?Sized> !marker::Sync for Weak<T> {} impl<T: ?Sized> !Sync for Weak<T> {}
#[unstable(feature = "coerce_unsized", issue = "18598")] #[unstable(feature = "coerce_unsized", issue = "18598")]
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {} impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}

View file

@ -45,9 +45,9 @@
use core::error::Error; use core::error::Error;
use core::fmt; use core::fmt;
use core::hash; use core::hash;
use core::iter::FusedIterator;
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
use core::iter::{from_fn, FromIterator}; use core::iter::from_fn;
use core::iter::FusedIterator;
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
use core::ops::Add; use core::ops::Add;
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]

View file

@ -11,14 +11,13 @@
use core::any::Any; use core::any::Any;
use core::borrow; use core::borrow;
use core::cmp::Ordering; use core::cmp::Ordering;
use core::convert::{From, TryFrom};
use core::fmt; use core::fmt;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::hint; use core::hint;
use core::intrinsics::abort; use core::intrinsics::abort;
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
use core::iter; use core::iter;
use core::marker::{PhantomData, Unpin, Unsize}; use core::marker::{PhantomData, Unsize};
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
use core::mem::size_of_val; use core::mem::size_of_val;
use core::mem::{self, align_of_val_raw}; use core::mem::{self, align_of_val_raw};
@ -188,8 +187,6 @@ macro_rules! acquire {
/// [mutex]: ../../std/sync/struct.Mutex.html /// [mutex]: ../../std/sync/struct.Mutex.html
/// [rwlock]: ../../std/sync/struct.RwLock.html /// [rwlock]: ../../std/sync/struct.RwLock.html
/// [atomic]: core::sync::atomic /// [atomic]: core::sync::atomic
/// [`Send`]: core::marker::Send
/// [`Sync`]: core::marker::Sync
/// [deref]: core::ops::Deref /// [deref]: core::ops::Deref
/// [downgrade]: Arc::downgrade /// [downgrade]: Arc::downgrade
/// [upgrade]: Weak::upgrade /// [upgrade]: Weak::upgrade
@ -1241,7 +1238,7 @@ impl<T: ?Sized> Arc<T> {
#[inline] #[inline]
#[stable(feature = "arc_mutate_strong_count", since = "1.51.0")] #[stable(feature = "arc_mutate_strong_count", since = "1.51.0")]
pub unsafe fn decrement_strong_count(ptr: *const T) { pub unsafe fn decrement_strong_count(ptr: *const T) {
unsafe { mem::drop(Arc::from_raw(ptr)) }; unsafe { drop(Arc::from_raw(ptr)) };
} }
#[inline] #[inline]
@ -1404,7 +1401,7 @@ impl<T> Arc<[T]> {
/// ///
/// Behavior is undefined should the size be wrong. /// Behavior is undefined should the size be wrong.
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
unsafe fn from_iter_exact(iter: impl iter::Iterator<Item = T>, len: usize) -> Arc<[T]> { unsafe fn from_iter_exact(iter: impl Iterator<Item = T>, len: usize) -> Arc<[T]> {
// Panic guard while cloning T elements. // Panic guard while cloning T elements.
// In the event of a panic, elements that have been written // In the event of a panic, elements that have been written
// into the new ArcInner will be dropped, then the memory freed. // into the new ArcInner will be dropped, then the memory freed.
@ -2818,7 +2815,7 @@ impl<T, const N: usize> TryFrom<Arc<[T]>> for Arc<[T; N]> {
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
#[stable(feature = "shared_from_iter", since = "1.37.0")] #[stable(feature = "shared_from_iter", since = "1.37.0")]
impl<T> iter::FromIterator<T> for Arc<[T]> { impl<T> FromIterator<T> for Arc<[T]> {
/// Takes each element in the `Iterator` and collects it into an `Arc<[T]>`. /// Takes each element in the `Iterator` and collects it into an `Arc<[T]>`.
/// ///
/// # Performance characteristics /// # Performance characteristics
@ -2857,7 +2854,7 @@ impl<T> iter::FromIterator<T> for Arc<[T]> {
/// let evens: Arc<[u8]> = (0..10).collect(); // Just a single allocation happens here. /// let evens: Arc<[u8]> = (0..10).collect(); // Just a single allocation happens here.
/// # assert_eq!(&*evens, &*(0..10).collect::<Vec<_>>()); /// # assert_eq!(&*evens, &*(0..10).collect::<Vec<_>>());
/// ``` /// ```
fn from_iter<I: iter::IntoIterator<Item = T>>(iter: I) -> Self { fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
ToArcSlice::to_arc_slice(iter.into_iter()) ToArcSlice::to_arc_slice(iter.into_iter())
} }
} }

View file

@ -1,5 +1,4 @@
use crate::borrow::Cow; use crate::borrow::Cow;
use core::iter::FromIterator;
use super::Vec; use super::Vec;

View file

@ -108,7 +108,7 @@ impl<T, A: Allocator> IntoIter<T, A> {
/// ``` /// ```
/// # let mut into_iter = Vec::<u8>::with_capacity(10).into_iter(); /// # let mut into_iter = Vec::<u8>::with_capacity(10).into_iter();
/// let mut into_iter = std::mem::replace(&mut into_iter, Vec::new().into_iter()); /// let mut into_iter = std::mem::replace(&mut into_iter, Vec::new().into_iter());
/// (&mut into_iter).for_each(core::mem::drop); /// (&mut into_iter).for_each(drop);
/// std::mem::forget(into_iter); /// std::mem::forget(into_iter);
/// ``` /// ```
/// ///

View file

@ -56,12 +56,9 @@
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
use core::cmp; use core::cmp;
use core::cmp::Ordering; use core::cmp::Ordering;
use core::convert::TryFrom;
use core::fmt; use core::fmt;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::iter; use core::iter;
#[cfg(not(no_global_oom_handling))]
use core::iter::FromIterator;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties}; use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties};
use core::ops::{self, Index, IndexMut, Range, RangeBounds}; use core::ops::{self, Index, IndexMut, Range, RangeBounds};
@ -2990,7 +2987,7 @@ impl<'a, T: Copy + 'a, A: Allocator + 'a> Extend<&'a T> for Vec<T, A> {
} }
} }
/// Implements comparison of vectors, [lexicographically](core::cmp::Ord#lexicographical-comparison). /// Implements comparison of vectors, [lexicographically](Ord#lexicographical-comparison).
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<T: PartialOrd, A: Allocator> PartialOrd for Vec<T, A> { impl<T: PartialOrd, A: Allocator> PartialOrd for Vec<T, A> {
#[inline] #[inline]
@ -3002,7 +2999,7 @@ impl<T: PartialOrd, A: Allocator> PartialOrd for Vec<T, A> {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<T: Eq, A: Allocator> Eq for Vec<T, A> {} impl<T: Eq, A: Allocator> Eq for Vec<T, A> {}
/// Implements ordering of vectors, [lexicographically](core::cmp::Ord#lexicographical-comparison). /// Implements ordering of vectors, [lexicographically](Ord#lexicographical-comparison).
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord, A: Allocator> Ord for Vec<T, A> { impl<T: Ord, A: Allocator> Ord for Vec<T, A> {
#[inline] #[inline]

View file

@ -19,7 +19,6 @@ use crate::ops::Try;
/// please open a GitHub issue explaining your use case. /// please open a GitHub issue explaining your use case.
/// ///
/// [`repeat()`]: crate::iter::repeat /// [`repeat()`]: crate::iter::repeat
/// [`DoubleEndedIterator`]: crate::iter::DoubleEndedIterator
/// ///
/// # Examples /// # Examples
/// ///

View file

@ -764,7 +764,6 @@ pub trait Iterator {
/// more idiomatic to use [`for`] than `map()`. /// more idiomatic to use [`for`] than `map()`.
/// ///
/// [`for`]: ../../book/ch03-05-control-flow.html#looping-through-a-collection-with-for /// [`for`]: ../../book/ch03-05-control-flow.html#looping-through-a-collection-with-for
/// [`FnMut`]: crate::ops::FnMut
/// ///
/// # Examples /// # Examples
/// ///

View file

@ -9,7 +9,7 @@ use crate::fmt;
use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
use crate::str::FromStr; use crate::str::FromStr;
trait ReadNumberHelper: crate::marker::Sized { trait ReadNumberHelper: Sized {
const ZERO: Self; const ZERO: Self;
fn checked_mul(&self, other: u32) -> Option<Self>; fn checked_mul(&self, other: u32) -> Option<Self>;
fn checked_add(&self, other: u32) -> Option<Self>; fn checked_add(&self, other: u32) -> Option<Self>;

View file

@ -577,7 +577,6 @@ impl Copy for () {
/// [`is_null`]: pointer::is_null /// [`is_null`]: pointer::is_null
/// [`offset`]: pointer::offset /// [`offset`]: pointer::offset
#[doc = concat!("[`into_raw`]: ", include_str!("../primitive_docs/box_into_raw.md"))] #[doc = concat!("[`into_raw`]: ", include_str!("../primitive_docs/box_into_raw.md"))]
/// [`drop`]: mem::drop
/// [`write`]: ptr::write /// [`write`]: ptr::write
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
mod prim_pointer {} mod prim_pointer {}
@ -1026,7 +1025,6 @@ mod prim_str {}
/// * [`UnwindSafe`] /// * [`UnwindSafe`]
/// * [`RefUnwindSafe`] /// * [`RefUnwindSafe`]
/// ///
/// [`Unpin`]: marker::Unpin
/// [`UnwindSafe`]: panic::UnwindSafe /// [`UnwindSafe`]: panic::UnwindSafe
/// [`RefUnwindSafe`]: panic::RefUnwindSafe /// [`RefUnwindSafe`]: panic::RefUnwindSafe
/// ///
@ -1405,10 +1403,6 @@ mod prim_ref {}
/// ///
/// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].* /// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].*
/// ///
/// [`Fn`]: ops::Fn
/// [`FnMut`]: ops::FnMut
/// [`FnOnce`]: ops::FnOnce
///
/// Function pointers are pointers that point to *code*, not data. They can be called /// Function pointers are pointers that point to *code*, not data. They can be called
/// just like functions. Like references, function pointers are, among other things, assumed to /// just like functions. Like references, function pointers are, among other things, assumed to
/// not be null, so if you want to pass a function pointer over FFI and be able to accommodate null /// not be null, so if you want to pass a function pointer over FFI and be able to accommodate null

View file

@ -69,9 +69,6 @@ use core::task::{Context, Poll};
/// for any value. This is a parallel with the fact that /// for any value. This is a parallel with the fact that
/// `&` and `&mut` references together can be thought of as a _compile-time_ /// `&` and `&mut` references together can be thought of as a _compile-time_
/// version of a read-write lock. /// version of a read-write lock.
///
///
/// [`Sync`]: core::marker::Sync
#[unstable(feature = "exclusive_wrapper", issue = "98407")] #[unstable(feature = "exclusive_wrapper", issue = "98407")]
#[doc(alias = "SyncWrapper")] #[doc(alias = "SyncWrapper")]
#[doc(alias = "SyncCell")] #[doc(alias = "SyncCell")]

View file

@ -257,7 +257,7 @@ where
} }
} }
impl<T, const LANES: usize> core::convert::From<Mask<T, LANES>> for Simd<T, LANES> impl<T, const LANES: usize> From<Mask<T, LANES>> for Simd<T, LANES>
where where
T: MaskElement, T: MaskElement,
LaneCount<LANES>: SupportedLaneCount, LaneCount<LANES>: SupportedLaneCount,

View file

@ -5,8 +5,6 @@
//! on the `rustc_hash` crate. //! on the `rustc_hash` crate.
use std::collections::HashMap; use std::collections::HashMap;
use std::convert::TryInto;
use std::default::Default;
use std::hash::BuildHasherDefault; use std::hash::BuildHasherDefault;
use std::hash::Hasher; use std::hash::Hasher;
use std::mem::size_of; use std::mem::size_of;

View file

@ -47,7 +47,7 @@ use std::cmp::Ordering;
use std::ops::RangeBounds; use std::ops::RangeBounds;
use std::path::PathBuf; use std::path::PathBuf;
use std::str::FromStr; use std::str::FromStr;
use std::{error, fmt, iter}; use std::{error, fmt};
/// Determines whether proc_macro has been made accessible to the currently /// Determines whether proc_macro has been made accessible to the currently
/// running program. /// running program.
@ -310,7 +310,7 @@ impl ConcatStreamsHelper {
/// Collects a number of token trees into a single stream. /// Collects a number of token trees into a single stream.
#[stable(feature = "proc_macro_lib2", since = "1.29.0")] #[stable(feature = "proc_macro_lib2", since = "1.29.0")]
impl iter::FromIterator<TokenTree> for TokenStream { impl FromIterator<TokenTree> for TokenStream {
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self { fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
let iter = trees.into_iter(); let iter = trees.into_iter();
let mut builder = ConcatTreesHelper::new(iter.size_hint().0); let mut builder = ConcatTreesHelper::new(iter.size_hint().0);
@ -322,7 +322,7 @@ impl iter::FromIterator<TokenTree> for TokenStream {
/// A "flattening" operation on token streams, collects token trees /// A "flattening" operation on token streams, collects token trees
/// from multiple token streams into a single stream. /// from multiple token streams into a single stream.
#[stable(feature = "proc_macro_lib", since = "1.15.0")] #[stable(feature = "proc_macro_lib", since = "1.15.0")]
impl iter::FromIterator<TokenStream> for TokenStream { impl FromIterator<TokenStream> for TokenStream {
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self { fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
let iter = streams.into_iter(); let iter = streams.into_iter();
let mut builder = ConcatStreamsHelper::new(iter.size_hint().0); let mut builder = ConcatStreamsHelper::new(iter.size_hint().0);

View file

@ -1446,7 +1446,6 @@ impl<'a, K, V> IterMut<'a, K, V> {
/// (provided by the [`IntoIterator`] trait). See its documentation for more. /// (provided by the [`IntoIterator`] trait). See its documentation for more.
/// ///
/// [`into_iter`]: IntoIterator::into_iter /// [`into_iter`]: IntoIterator::into_iter
/// [`IntoIterator`]: crate::iter::IntoIterator
/// ///
/// # Example /// # Example
/// ///

View file

@ -1272,7 +1272,6 @@ pub struct Iter<'a, K: 'a> {
/// (provided by the [`IntoIterator`] trait). See its documentation for more. /// (provided by the [`IntoIterator`] trait). See its documentation for more.
/// ///
/// [`into_iter`]: IntoIterator::into_iter /// [`into_iter`]: IntoIterator::into_iter
/// [`IntoIterator`]: crate::iter::IntoIterator
/// ///
/// # Examples /// # Examples
/// ///

View file

@ -398,8 +398,6 @@
//! // ...but the key hasn't changed. b is still "baz", not "xyz". //! // ...but the key hasn't changed. b is still "baz", not "xyz".
//! assert_eq!(map.keys().next().unwrap().b, "baz"); //! assert_eq!(map.keys().next().unwrap().b, "baz");
//! ``` //! ```
//!
//! [IntoIterator]: crate::iter::IntoIterator "iter::IntoIterator"
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]

View file

@ -6,7 +6,6 @@ use crate::cmp;
use crate::collections::TryReserveError; use crate::collections::TryReserveError;
use crate::fmt; use crate::fmt;
use crate::hash::{Hash, Hasher}; use crate::hash::{Hash, Hasher};
use crate::iter::Extend;
use crate::ops; use crate::ops;
use crate::rc::Rc; use crate::rc::Rc;
use crate::str::FromStr; use crate::str::FromStr;

View file

@ -11,7 +11,6 @@ mod repr_unpacked;
#[cfg(not(target_pointer_width = "64"))] #[cfg(not(target_pointer_width = "64"))]
use repr_unpacked::Repr; use repr_unpacked::Repr;
use crate::convert::From;
use crate::error; use crate::error;
use crate::fmt; use crate::fmt;
use crate::result; use crate::result;

View file

@ -1678,7 +1678,7 @@ mod super_keyword {}
/// below `Iterator` is a **supertrait** and `ThreeIterator` is a **subtrait**: /// below `Iterator` is a **supertrait** and `ThreeIterator` is a **subtrait**:
/// ///
/// ```rust /// ```rust
/// trait ThreeIterator: std::iter::Iterator { /// trait ThreeIterator: Iterator {
/// fn next_three(&mut self) -> Option<[Self::Item; 3]>; /// fn next_three(&mut self) -> Option<[Self::Item; 3]>;
/// } /// }
/// ``` /// ```

View file

@ -78,7 +78,7 @@ use crate::fmt;
use crate::fs; use crate::fs;
use crate::hash::{Hash, Hasher}; use crate::hash::{Hash, Hasher};
use crate::io; use crate::io;
use crate::iter::{self, FusedIterator}; use crate::iter::FusedIterator;
use crate::ops::{self, Deref}; use crate::ops::{self, Deref};
use crate::rc::Rc; use crate::rc::Rc;
use crate::str::FromStr; use crate::str::FromStr;
@ -450,26 +450,26 @@ impl<'a> PrefixComponent<'a> {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<'a> cmp::PartialEq for PrefixComponent<'a> { impl<'a> PartialEq for PrefixComponent<'a> {
#[inline] #[inline]
fn eq(&self, other: &PrefixComponent<'a>) -> bool { fn eq(&self, other: &PrefixComponent<'a>) -> bool {
cmp::PartialEq::eq(&self.parsed, &other.parsed) self.parsed == other.parsed
} }
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<'a> cmp::PartialOrd for PrefixComponent<'a> { impl<'a> PartialOrd for PrefixComponent<'a> {
#[inline] #[inline]
fn partial_cmp(&self, other: &PrefixComponent<'a>) -> Option<cmp::Ordering> { fn partial_cmp(&self, other: &PrefixComponent<'a>) -> Option<cmp::Ordering> {
cmp::PartialOrd::partial_cmp(&self.parsed, &other.parsed) PartialOrd::partial_cmp(&self.parsed, &other.parsed)
} }
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::Ord for PrefixComponent<'_> { impl Ord for PrefixComponent<'_> {
#[inline] #[inline]
fn cmp(&self, other: &Self) -> cmp::Ordering { fn cmp(&self, other: &Self) -> cmp::Ordering {
cmp::Ord::cmp(&self.parsed, &other.parsed) Ord::cmp(&self.parsed, &other.parsed)
} }
} }
@ -988,7 +988,7 @@ impl<'a> DoubleEndedIterator for Components<'a> {
impl FusedIterator for Components<'_> {} impl FusedIterator for Components<'_> {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<'a> cmp::PartialEq for Components<'a> { impl<'a> PartialEq for Components<'a> {
#[inline] #[inline]
fn eq(&self, other: &Components<'a>) -> bool { fn eq(&self, other: &Components<'a>) -> bool {
let Components { path: _, front: _, back: _, has_physical_root: _, prefix: _ } = self; let Components { path: _, front: _, back: _, has_physical_root: _, prefix: _ } = self;
@ -1015,10 +1015,10 @@ impl<'a> cmp::PartialEq for Components<'a> {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::Eq for Components<'_> {} impl Eq for Components<'_> {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<'a> cmp::PartialOrd for Components<'a> { impl<'a> PartialOrd for Components<'a> {
#[inline] #[inline]
fn partial_cmp(&self, other: &Components<'a>) -> Option<cmp::Ordering> { fn partial_cmp(&self, other: &Components<'a>) -> Option<cmp::Ordering> {
Some(compare_components(self.clone(), other.clone())) Some(compare_components(self.clone(), other.clone()))
@ -1026,7 +1026,7 @@ impl<'a> cmp::PartialOrd for Components<'a> {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::Ord for Components<'_> { impl Ord for Components<'_> {
#[inline] #[inline]
fn cmp(&self, other: &Self) -> cmp::Ordering { fn cmp(&self, other: &Self) -> cmp::Ordering {
compare_components(self.clone(), other.clone()) compare_components(self.clone(), other.clone())
@ -1741,7 +1741,7 @@ impl FromStr for PathBuf {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<P: AsRef<Path>> iter::FromIterator<P> for PathBuf { impl<P: AsRef<Path>> FromIterator<P> for PathBuf {
fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> PathBuf { fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> PathBuf {
let mut buf = PathBuf::new(); let mut buf = PathBuf::new();
buf.extend(iter); buf.extend(iter);
@ -1750,7 +1750,7 @@ impl<P: AsRef<Path>> iter::FromIterator<P> for PathBuf {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<P: AsRef<Path>> iter::Extend<P> for PathBuf { impl<P: AsRef<Path>> Extend<P> for PathBuf {
fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I) { fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I) {
iter.into_iter().for_each(move |p| self.push(p.as_ref())); iter.into_iter().for_each(move |p| self.push(p.as_ref()));
} }
@ -1904,7 +1904,7 @@ impl ToOwned for Path {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::PartialEq for PathBuf { impl PartialEq for PathBuf {
#[inline] #[inline]
fn eq(&self, other: &PathBuf) -> bool { fn eq(&self, other: &PathBuf) -> bool {
self.components() == other.components() self.components() == other.components()
@ -1919,10 +1919,10 @@ impl Hash for PathBuf {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::Eq for PathBuf {} impl Eq for PathBuf {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::PartialOrd for PathBuf { impl PartialOrd for PathBuf {
#[inline] #[inline]
fn partial_cmp(&self, other: &PathBuf) -> Option<cmp::Ordering> { fn partial_cmp(&self, other: &PathBuf) -> Option<cmp::Ordering> {
Some(compare_components(self.components(), other.components())) Some(compare_components(self.components(), other.components()))
@ -1930,7 +1930,7 @@ impl cmp::PartialOrd for PathBuf {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::Ord for PathBuf { impl Ord for PathBuf {
#[inline] #[inline]
fn cmp(&self, other: &PathBuf) -> cmp::Ordering { fn cmp(&self, other: &PathBuf) -> cmp::Ordering {
compare_components(self.components(), other.components()) compare_components(self.components(), other.components())
@ -3025,7 +3025,7 @@ impl fmt::Display for Display<'_> {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::PartialEq for Path { impl PartialEq for Path {
#[inline] #[inline]
fn eq(&self, other: &Path) -> bool { fn eq(&self, other: &Path) -> bool {
self.components() == other.components() self.components() == other.components()
@ -3084,10 +3084,10 @@ impl Hash for Path {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::Eq for Path {} impl Eq for Path {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::PartialOrd for Path { impl PartialOrd for Path {
#[inline] #[inline]
fn partial_cmp(&self, other: &Path) -> Option<cmp::Ordering> { fn partial_cmp(&self, other: &Path) -> Option<cmp::Ordering> {
Some(compare_components(self.components(), other.components())) Some(compare_components(self.components(), other.components()))
@ -3095,7 +3095,7 @@ impl cmp::PartialOrd for Path {
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl cmp::Ord for Path { impl Ord for Path {
#[inline] #[inline]
fn cmp(&self, other: &Path) -> cmp::Ordering { fn cmp(&self, other: &Path) -> cmp::Ordering {
compare_components(self.components(), other.components()) compare_components(self.components(), other.components())

View file

@ -34,7 +34,7 @@
//! marker traits that indicate fundamental properties of types. //! marker traits that indicate fundamental properties of types.
//! * <code>[std::ops]::{[Drop], [Fn], [FnMut], [FnOnce]}</code>, various //! * <code>[std::ops]::{[Drop], [Fn], [FnMut], [FnOnce]}</code>, various
//! operations for both destructors and overloading `()`. //! operations for both destructors and overloading `()`.
//! * <code>[std::mem]::[drop][mem::drop]</code>, a convenience function for explicitly //! * <code>[std::mem]::[drop]</code>, a convenience function for explicitly
//! dropping a value. //! dropping a value.
//! * <code>[std::boxed]::[Box]</code>, a way to allocate values on the heap. //! * <code>[std::boxed]::[Box]</code>, a way to allocate values on the heap.
//! * <code>[std::borrow]::[ToOwned]</code>, the conversion trait that defines //! * <code>[std::borrow]::[ToOwned]</code>, the conversion trait that defines
@ -66,7 +66,6 @@
//! * <code>[std::convert]::{[TryFrom], [TryInto]}</code>, //! * <code>[std::convert]::{[TryFrom], [TryInto]}</code>,
//! * <code>[std::iter]::[FromIterator]</code>. //! * <code>[std::iter]::[FromIterator]</code>.
//! //!
//! [mem::drop]: crate::mem::drop
//! [std::borrow]: crate::borrow //! [std::borrow]: crate::borrow
//! [std::boxed]: crate::boxed //! [std::boxed]: crate::boxed
//! [std::clone]: crate::clone //! [std::clone]: crate::clone
@ -86,9 +85,6 @@
//! [std::slice]: crate::slice //! [std::slice]: crate::slice
//! [std::string]: crate::string //! [std::string]: crate::string
//! [std::vec]: mod@crate::vec //! [std::vec]: mod@crate::vec
//! [TryFrom]: crate::convert::TryFrom
//! [TryInto]: crate::convert::TryInto
//! [FromIterator]: crate::iter::FromIterator
//! [`to_owned`]: crate::borrow::ToOwned::to_owned //! [`to_owned`]: crate::borrow::ToOwned::to_owned
//! [book-closures]: ../../book/ch13-01-closures.html //! [book-closures]: ../../book/ch13-01-closures.html
//! [book-dtor]: ../../book/ch15-03-drop.html //! [book-dtor]: ../../book/ch15-03-drop.html

View file

@ -577,7 +577,6 @@ impl Copy for () {
/// [`is_null`]: pointer::is_null /// [`is_null`]: pointer::is_null
/// [`offset`]: pointer::offset /// [`offset`]: pointer::offset
#[doc = concat!("[`into_raw`]: ", include_str!("../primitive_docs/box_into_raw.md"))] #[doc = concat!("[`into_raw`]: ", include_str!("../primitive_docs/box_into_raw.md"))]
/// [`drop`]: mem::drop
/// [`write`]: ptr::write /// [`write`]: ptr::write
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
mod prim_pointer {} mod prim_pointer {}
@ -1026,7 +1025,6 @@ mod prim_str {}
/// * [`UnwindSafe`] /// * [`UnwindSafe`]
/// * [`RefUnwindSafe`] /// * [`RefUnwindSafe`]
/// ///
/// [`Unpin`]: marker::Unpin
/// [`UnwindSafe`]: panic::UnwindSafe /// [`UnwindSafe`]: panic::UnwindSafe
/// [`RefUnwindSafe`]: panic::RefUnwindSafe /// [`RefUnwindSafe`]: panic::RefUnwindSafe
/// ///
@ -1405,10 +1403,6 @@ mod prim_ref {}
/// ///
/// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].* /// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].*
/// ///
/// [`Fn`]: ops::Fn
/// [`FnMut`]: ops::FnMut
/// [`FnOnce`]: ops::FnOnce
///
/// Function pointers are pointers that point to *code*, not data. They can be called /// Function pointers are pointers that point to *code*, not data. They can be called
/// just like functions. Like references, function pointers are, among other things, assumed to /// just like functions. Like references, function pointers are, among other things, assumed to
/// not be null, so if you want to pass a function pointer over FFI and be able to accommodate null /// not be null, so if you want to pass a function pointer over FFI and be able to accommodate null

View file

@ -3,7 +3,6 @@
use crate::arch::asm; use crate::arch::asm;
use crate::cell::UnsafeCell; use crate::cell::UnsafeCell;
use crate::cmp; use crate::cmp;
use crate::convert::TryInto;
use crate::mem; use crate::mem;
use crate::ops::{CoerceUnsized, Deref, DerefMut, Index, IndexMut}; use crate::ops::{CoerceUnsized, Deref, DerefMut, Index, IndexMut};
use crate::ptr::{self, NonNull}; use crate::ptr::{self, NonNull};

View file

@ -273,8 +273,6 @@ pub mod zircon {
#[cfg(target_os = "fuchsia")] #[cfg(target_os = "fuchsia")]
pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) -> bool { pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) -> bool {
use crate::convert::TryFrom;
// Sleep forever if the timeout is longer than fits in a i64. // Sleep forever if the timeout is longer than fits in a i64.
let deadline = timeout let deadline = timeout
.and_then(|d| { .and_then(|d| {

View file

@ -7,7 +7,6 @@ mod tests;
use crate::os::unix::prelude::*; use crate::os::unix::prelude::*;
use crate::convert::TryFrom;
use crate::error::Error as StdError; use crate::error::Error as StdError;
use crate::ffi::{CStr, CString, OsStr, OsString}; use crate::ffi::{CStr, CString, OsStr, OsString};
use crate::fmt; use crate::fmt;

View file

@ -166,7 +166,6 @@ impl Process {
} }
pub fn wait(&mut self) -> io::Result<ExitStatus> { pub fn wait(&mut self) -> io::Result<ExitStatus> {
use crate::default::Default;
use crate::sys::process::zircon::*; use crate::sys::process::zircon::*;
let mut proc_info: zx_info_process_t = Default::default(); let mut proc_info: zx_info_process_t = Default::default();
@ -199,7 +198,6 @@ impl Process {
} }
pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> { pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> {
use crate::default::Default;
use crate::sys::process::zircon::*; use crate::sys::process::zircon::*;
let mut proc_info: zx_info_process_t = Default::default(); let mut proc_info: zx_info_process_t = Default::default();

View file

@ -2,7 +2,6 @@
mod tests; mod tests;
use crate::cmp; use crate::cmp;
use crate::convert::{TryFrom, TryInto};
use crate::fmt; use crate::fmt;
use crate::io::{self, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut}; use crate::io::{self, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut};
use crate::mem; use crate::mem;

View file

@ -1,9 +1,8 @@
use std::any::{Any, TypeId}; use std::any::{Any, TypeId};
use std::borrow::Borrow; use std::borrow::Borrow;
use std::cell::RefCell; use std::cell::RefCell;
use std::cmp::{Ord, Ordering, PartialOrd}; use std::cmp::Ordering;
use std::collections::HashMap; use std::collections::HashMap;
use std::convert::AsRef;
use std::fmt; use std::fmt;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use std::marker::PhantomData; use std::marker::PhantomData;

View file

@ -35,7 +35,6 @@ use rustc_span::{self, ExpnKind};
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::hash_map::Entry; use std::collections::hash_map::Entry;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::default::Default;
use std::hash::Hash; use std::hash::Hash;
use std::mem; use std::mem;
use thin_vec::ThinVec; use thin_vec::ThinVec;

View file

@ -1,6 +1,5 @@
use std::borrow::Cow; use std::borrow::Cow;
use std::cell::RefCell; use std::cell::RefCell;
use std::default::Default;
use std::hash::Hash; use std::hash::Hash;
use std::path::PathBuf; use std::path::PathBuf;
use std::rc::Rc; use std::rc::Rc;
@ -980,7 +979,7 @@ pub(crate) trait NestedAttributesExt {
/// Returns `true` if the attribute list contains a specific `word` /// Returns `true` if the attribute list contains a specific `word`
fn has_word(self, word: Symbol) -> bool fn has_word(self, word: Symbol) -> bool
where where
Self: std::marker::Sized, Self: Sized,
{ {
<Self as NestedAttributesExt>::get_word_attr(self, word).is_some() <Self as NestedAttributesExt>::get_word_attr(self, word).is_some()
} }

View file

@ -1,5 +1,4 @@
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::ffi::OsStr; use std::ffi::OsStr;
use std::fmt; use std::fmt;
use std::path::PathBuf; use std::path::PathBuf;

View file

@ -36,7 +36,6 @@ use rustc_span::{Span, Symbol};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::default::Default;
use std::fmt::Write; use std::fmt::Write;
use std::ops::{ControlFlow, Range}; use std::ops::{ControlFlow, Range};
use std::str; use std::str;

View file

@ -38,7 +38,6 @@ pub(crate) use self::context::*;
pub(crate) use self::span_map::{collect_spans_and_sources, LinkFromSrc}; pub(crate) use self::span_map::{collect_spans_and_sources, LinkFromSrc};
use std::collections::VecDeque; use std::collections::VecDeque;
use std::default::Default;
use std::fmt::{self, Write}; use std::fmt::{self, Write};
use std::fs; use std::fs;
use std::iter::Peekable; use std::iter::Peekable;

View file

@ -59,7 +59,7 @@ pub(crate) fn build_index<'tcx>(
// `sort_unstable_by_key` produces lifetime errors // `sort_unstable_by_key` produces lifetime errors
let k1 = (&k1.path, k1.name.as_str(), &k1.ty, &k1.parent); let k1 = (&k1.path, k1.name.as_str(), &k1.ty, &k1.parent);
let k2 = (&k2.path, k2.name.as_str(), &k2.ty, &k2.parent); let k2 = (&k2.path, k2.name.as_str(), &k2.ty, &k2.parent);
std::cmp::Ord::cmp(&k1, &k2) Ord::cmp(&k1, &k2)
}); });
// Set up alias indexes. // Set up alias indexes.

View file

@ -4,7 +4,6 @@
#![allow(rustc::default_hash_types)] #![allow(rustc::default_hash_types)]
use std::convert::From;
use std::fmt; use std::fmt;
use rustc_ast::ast; use rustc_ast::ast;

View file

@ -69,7 +69,6 @@ extern crate test;
#[cfg(feature = "jemalloc")] #[cfg(feature = "jemalloc")]
extern crate jemalloc_sys; extern crate jemalloc_sys;
use std::default::Default;
use std::env::{self, VarError}; use std::env::{self, VarError};
use std::io::{self, IsTerminal}; use std::io::{self, IsTerminal};
use std::process; use std::process;

View file

@ -2,7 +2,6 @@ use anyhow::{Context, Error};
use curl::easy::Easy; use curl::easy::Easy;
use indexmap::IndexMap; use indexmap::IndexMap;
use std::collections::HashMap; use std::collections::HashMap;
use std::convert::TryInto;
const PATH: &str = "src/stage0.json"; const PATH: &str = "src/stage0.json";
const COMPILER_COMPONENTS: &[&str] = &["rustc", "rust-std", "cargo"]; const COMPILER_COMPONENTS: &[&str] = &["rustc", "rust-std", "cargo"];

View file

@ -57,8 +57,8 @@ mod os_impl {
match fs::File::create(&path) { match fs::File::create(&path) {
Ok(file) => { Ok(file) => {
let exec = is_executable(&path).unwrap_or(false); let exec = is_executable(&path).unwrap_or(false);
std::mem::drop(file); drop(file);
std::fs::remove_file(&path).expect("Deleted temp file"); fs::remove_file(&path).expect("Deleted temp file");
// If the file is executable, then we assume that this // If the file is executable, then we assume that this
// filesystem does not track executability, so skip this check. // filesystem does not track executability, so skip this check.
return if exec { Unsupported } else { Supported }; return if exec { Unsupported } else { Supported };

View file

@ -31,7 +31,6 @@
//! this in the long term. //! this in the long term.
use crate::walk::{filter_dirs, walk}; use crate::walk::{filter_dirs, walk};
use std::iter::Iterator;
use std::path::Path; use std::path::Path;
// Paths that may contain platform-specific code. // Paths that may contain platform-specific code.

View file

@ -1,6 +1,5 @@
use crate::fmt_list; use crate::fmt_list;
use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::collections::{BTreeMap, BTreeSet, HashMap};
use std::convert::TryFrom;
use std::fmt::{self, Write}; use std::fmt::{self, Write};
use std::ops::Range; use std::ops::Range;

View file

@ -1,6 +1,5 @@
use crate::fmt_list; use crate::fmt_list;
use crate::raw_emitter::RawEmitter; use crate::raw_emitter::RawEmitter;
use std::convert::TryInto;
use std::fmt::Write as _; use std::fmt::Write as _;
use std::ops::Range; use std::ops::Range;

View file

@ -1,2 +1,2 @@
thread 'main' panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:525:5 thread 'main' panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:524:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace