diff options
| author | bors <bors@rust-lang.org> | 2019-02-03 18:40:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-02-03 18:40:23 +0000 |
| commit | 4f4f4a40b6c7bcb6fa07ee6575e8a9759ba08922 (patch) | |
| tree | 28a3d197b75da9125cc8f6de8d912f75c56e7e48 /src/liballoc/boxed.rs | |
| parent | e858c2637fa5bac40ac450628b30c56c2b4327b4 (diff) | |
| parent | 2396780cdaedf097dd6a8f3927749bcaf5b1238b (diff) | |
Auto merge of #58081 - Centril:liballoc-2018, r=oli-obk
Transition liballoc to Rust 2018 This transitions liballoc to Rust 2018 edition and applies relevant idiom lints. I also did a small bit of drive-by cleanup along the way. r? @oli-obk I started with liballoc since it seemed easiest. In particular, adding `edition = "2018"` to libcore gave me way too many errors due to stdsimd. Ideally we should be able to continue this crate-by-crate until all crates use 2018.
Diffstat (limited to 'src/liballoc/boxed.rs')
| -rw-r--r-- | src/liballoc/boxed.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 14a1242e3e5..8e01e12e0b8 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -73,9 +73,9 @@ use core::ops::{ use core::ptr::{self, NonNull, Unique}; use core::task::{LocalWaker, Poll}; -use vec::Vec; -use raw_vec::RawVec; -use str::from_boxed_utf8_unchecked; +use crate::vec::Vec; +use crate::raw_vec::RawVec; +use crate::str::from_boxed_utf8_unchecked; /// A pointer type for heap allocation. /// @@ -603,21 +603,21 @@ impl Box<dyn Any + Send> { #[stable(feature = "rust1", since = "1.0.0")] impl<T: fmt::Display + ?Sized> fmt::Display for Box<T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Display::fmt(&**self, f) } } #[stable(feature = "rust1", since = "1.0.0")] impl<T: fmt::Debug + ?Sized> fmt::Debug for Box<T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(&**self, f) } } #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> fmt::Pointer for Box<T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // It's not possible to extract the inner Uniq directly from the Box, // instead we cast it to a *const which aliases the Unique let ptr: *const T = &**self; @@ -737,7 +737,7 @@ impl<A, F> FnBox<A> for F #[unstable(feature = "fnbox", reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")] -impl<'a, A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + 'a> { +impl<A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + '_> { type Output = R; extern "rust-call" fn call_once(self, args: A) -> R { @@ -747,7 +747,7 @@ impl<'a, A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + 'a> { #[unstable(feature = "fnbox", reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")] -impl<'a, A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + Send + 'a> { +impl<A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + Send + '_> { type Output = R; extern "rust-call" fn call_once(self, args: A) -> R { |
