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/slice.rs | |
| parent | e858c2637fa5bac40ac450628b30c56c2b4327b4 (diff) | |
| parent | 2396780cdaedf097dd6a8f3927749bcaf5b1238b (diff) | |
| download | rust-4f4f4a40b6c7bcb6fa07ee6575e8a9759ba08922.tar.gz rust-4f4f4a40b6c7bcb6fa07ee6575e8a9759ba08922.zip | |
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/slice.rs')
| -rw-r--r-- | src/liballoc/slice.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index db19f778617..479959deeb1 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -87,15 +87,15 @@ // It's cleaner to just turn off the unused_imports warning than to fix them. #![cfg_attr(test, allow(unused_imports, dead_code))] +use core::borrow::{Borrow, BorrowMut}; use core::cmp::Ordering::{self, Less}; -use core::mem::size_of; -use core::mem; +use core::mem::{self, size_of}; use core::ptr; use core::{u8, u16, u32}; -use borrow::{Borrow, BorrowMut, ToOwned}; -use boxed::Box; -use vec::Vec; +use crate::borrow::ToOwned; +use crate::boxed::Box; +use crate::vec::Vec; #[stable(feature = "rust1", since = "1.0.0")] pub use core::slice::{Chunks, Windows}; @@ -125,24 +125,24 @@ pub use core::slice::{RChunks, RChunksMut, RChunksExact, RChunksExactMut}; // HACK(japaric) needed for the implementation of `vec!` macro during testing // NB see the hack module in this file for more details #[cfg(test)] -pub use self::hack::into_vec; +pub use hack::into_vec; // HACK(japaric) needed for the implementation of `Vec::clone` during testing // NB see the hack module in this file for more details #[cfg(test)] -pub use self::hack::to_vec; +pub use hack::to_vec; // HACK(japaric): With cfg(test) `impl [T]` is not available, these three // functions are actually methods that are in `impl [T]` but not in // `core::slice::SliceExt` - we need to supply these functions for the // `test_permutations` test mod hack { - use boxed::Box; use core::mem; + use crate::boxed::Box; + use crate::vec::Vec; #[cfg(test)] - use string::ToString; - use vec::Vec; + use crate::string::ToString; pub fn into_vec<T>(mut b: Box<[T]>) -> Vec<T> { unsafe { |
