Skip to content

Commit e6e2792

Browse files
committed
liballoc: cargo check passes on 2018
1 parent 5594b0d commit e6e2792

File tree

20 files changed

+61
-60
lines changed

20 files changed

+61
-60
lines changed

src/liballoc/borrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use core::cmp::Ordering;
66
use core::hash::{Hash, Hasher};
77
use core::ops::{Add, AddAssign, Deref};
88

9-
use fmt;
10-
use string::String;
9+
use crate::fmt;
10+
use crate::string::String;
1111

1212
use self::Cow::*;
1313

src/liballoc/boxed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ use core::ops::{
7373
use core::ptr::{self, NonNull, Unique};
7474
use core::task::{LocalWaker, Poll};
7575

76-
use vec::Vec;
77-
use raw_vec::RawVec;
78-
use str::from_boxed_utf8_unchecked;
76+
use crate::vec::Vec;
77+
use crate::raw_vec::RawVec;
78+
use crate::str::from_boxed_utf8_unchecked;
7979

8080
/// A pointer type for heap allocation.
8181
///

src/liballoc/collections/binary_heap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ use core::mem::{swap, size_of, ManuallyDrop};
151151
use core::ptr;
152152
use core::fmt;
153153

154-
use slice;
155-
use vec::{self, Vec};
154+
use crate::slice;
155+
use crate::vec::{self, Vec};
156156

157157
use super::SpecExtend;
158158

src/liballoc/collections/btree/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use core::ops::Index;
88
use core::ops::RangeBounds;
99
use core::{fmt, intrinsics, mem, ptr};
1010

11-
use borrow::Borrow;
11+
use crate::borrow::Borrow;
1212

1313
use super::node::{self, Handle, NodeRef, marker};
1414
use super::search;

src/liballoc/collections/btree/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ use core::mem::{self, MaybeUninit};
3636
use core::ptr::{self, Unique, NonNull};
3737
use core::slice;
3838

39-
use alloc::{Global, Alloc, Layout};
40-
use boxed::Box;
39+
use crate::alloc::{Global, Alloc, Layout};
40+
use crate::boxed::Box;
4141

4242
const B: usize = 6;
4343
pub const MIN_LEN: usize = B - 1;

src/liballoc/collections/btree/search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use core::cmp::Ordering;
22

3-
use borrow::Borrow;
3+
use crate::borrow::Borrow;
44

55
use super::node::{Handle, NodeRef, marker};
66

src/liballoc/collections/btree/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use core::fmt;
88
use core::iter::{Peekable, FromIterator, FusedIterator};
99
use core::ops::{BitOr, BitAnd, BitXor, Sub, RangeBounds};
1010

11-
use borrow::Borrow;
12-
use collections::btree_map::{self, BTreeMap, Keys};
11+
use crate::borrow::Borrow;
12+
use crate::collections::btree_map::{self, BTreeMap, Keys};
1313
use super::Recover;
1414

1515
// FIXME(conventions): implement bounded iterators

src/liballoc/collections/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use core::marker::PhantomData;
2020
use core::mem;
2121
use core::ptr::NonNull;
2222

23-
use boxed::Box;
23+
use crate::boxed::Box;
2424
use super::SpecExtend;
2525

2626
/// A doubly-linked list with owned nodes.

src/liballoc/collections/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub use self::linked_list::LinkedList;
4141
#[doc(no_inline)]
4242
pub use self::vec_deque::VecDeque;
4343

44-
use alloc::{AllocErr, LayoutErr};
44+
use crate::alloc::{AllocErr, LayoutErr};
4545

4646
/// Augments `AllocErr` with a CapacityOverflow variant.
4747
#[derive(Clone, PartialEq, Eq, Debug)]

src/liballoc/collections/vec_deque.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ use core::slice;
2020
use core::hash::{Hash, Hasher};
2121
use core::cmp;
2222

23-
use collections::CollectionAllocErr;
24-
use raw_vec::RawVec;
25-
use vec::Vec;
23+
use crate::collections::CollectionAllocErr;
24+
use crate::raw_vec::RawVec;
25+
use crate::vec::Vec;
2626

2727
const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
2828
const MINIMUM_CAPACITY: usize = 1; // 2 - 1

src/liballoc/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
527527
#[stable(feature = "fmt_flags_align", since = "1.28.0")]
528528
pub use core::fmt::{Alignment};
529529

530-
use string;
530+
use crate::string;
531531

532532
/// The `format` function takes an [`Arguments`] struct and returns the resulting
533533
/// formatted string.

src/liballoc/prelude.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
1313
#![unstable(feature = "alloc", issue = "27783")]
1414

15-
#[unstable(feature = "alloc", issue = "27783")] pub use borrow::ToOwned;
16-
#[unstable(feature = "alloc", issue = "27783")] pub use boxed::Box;
17-
#[unstable(feature = "alloc", issue = "27783")] pub use slice::SliceConcatExt;
18-
#[unstable(feature = "alloc", issue = "27783")] pub use string::{String, ToString};
19-
#[unstable(feature = "alloc", issue = "27783")] pub use vec::Vec;
15+
#[unstable(feature = "alloc", issue = "27783")] pub use crate::borrow::ToOwned;
16+
#[unstable(feature = "alloc", issue = "27783")] pub use crate::boxed::Box;
17+
#[unstable(feature = "alloc", issue = "27783")] pub use crate::slice::SliceConcatExt;
18+
#[unstable(feature = "alloc", issue = "27783")] pub use crate::string::{String, ToString};
19+
#[unstable(feature = "alloc", issue = "27783")] pub use crate::vec::Vec;

src/liballoc/raw_vec.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use core::ops::Drop;
77
use core::ptr::{self, NonNull, Unique};
88
use core::slice;
99

10-
use alloc::{Alloc, Layout, Global, handle_alloc_error};
11-
use collections::CollectionAllocErr;
12-
use collections::CollectionAllocErr::*;
13-
use boxed::Box;
10+
use crate::alloc::{Alloc, Layout, Global, handle_alloc_error};
11+
use crate::collections::CollectionAllocErr;
12+
use crate::collections::CollectionAllocErr::*;
13+
use crate::boxed::Box;
1414

1515
/// A low-level utility for more ergonomically allocating, reallocating, and deallocating
1616
/// a buffer of memory on the heap without having to worry about all the corner cases
@@ -639,7 +639,7 @@ impl<T, A: Alloc> RawVec<T, A> {
639639
strategy: ReserveStrategy,
640640
) -> Result<(), CollectionAllocErr> {
641641
unsafe {
642-
use alloc::AllocErr;
642+
use crate::alloc::AllocErr;
643643

644644
// NOTE: we don't early branch on ZSTs here because we want this
645645
// to actually catch "asking for more than usize::MAX" in that case.

src/liballoc/rc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
#![stable(feature = "rust1", since = "1.0.0")]
228228

229229
#[cfg(not(test))]
230-
use boxed::Box;
230+
use crate::boxed::Box;
231231
#[cfg(test)]
232232
use std::boxed::Box;
233233

@@ -248,9 +248,9 @@ use core::ptr::{self, NonNull};
248248
use core::convert::From;
249249
use core::usize;
250250

251-
use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
252-
use string::String;
253-
use vec::Vec;
251+
use crate::alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
252+
use crate::string::String;
253+
use crate::vec::Vec;
254254

255255
struct RcBox<T: ?Sized> {
256256
strong: Cell<usize>,

src/liballoc/slice.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ use core::mem;
9393
use core::ptr;
9494
use core::{u8, u16, u32};
9595

96-
use borrow::{Borrow, BorrowMut, ToOwned};
97-
use boxed::Box;
98-
use vec::Vec;
96+
use crate::borrow::{Borrow, BorrowMut, ToOwned};
97+
use crate::boxed::Box;
98+
use crate::vec::Vec;
9999

100100
#[stable(feature = "rust1", since = "1.0.0")]
101101
pub use core::slice::{Chunks, Windows};
@@ -137,12 +137,13 @@ pub use self::hack::to_vec;
137137
// `core::slice::SliceExt` - we need to supply these functions for the
138138
// `test_permutations` test
139139
mod hack {
140-
use boxed::Box;
141140
use core::mem;
141+
use crate::boxed::Box;
142142

143143
#[cfg(test)]
144-
use string::ToString;
145-
use vec::Vec;
144+
use crate::string::ToString;
145+
146+
use crate::vec::Vec;
146147

147148
pub fn into_vec<T>(mut b: Box<[T]>) -> Vec<T> {
148149
unsafe {

src/liballoc/str.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ use core::ptr;
3737
use core::iter::FusedIterator;
3838
use core::unicode::conversions;
3939

40-
use borrow::{Borrow, ToOwned};
41-
use boxed::Box;
42-
use slice::{SliceConcatExt, SliceIndex};
43-
use string::String;
44-
use vec::Vec;
40+
use crate::borrow::{Borrow, ToOwned};
41+
use crate::boxed::Box;
42+
use crate::slice::{SliceConcatExt, SliceIndex};
43+
use crate::string::String;
44+
use crate::vec::Vec;
4545

4646
#[stable(feature = "rust1", since = "1.0.0")]
4747
pub use core::str::{FromStr, Utf8Error};

src/liballoc/string.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ use core::ptr;
5656
use core::str::pattern::Pattern;
5757
use core::str::lossy;
5858

59-
use collections::CollectionAllocErr;
60-
use borrow::{Cow, ToOwned};
61-
use boxed::Box;
62-
use str::{self, from_boxed_utf8_unchecked, FromStr, Utf8Error, Chars};
63-
use vec::Vec;
59+
use crate::collections::CollectionAllocErr;
60+
use crate::borrow::{Cow, ToOwned};
61+
use crate::boxed::Box;
62+
use crate::str::{self, from_boxed_utf8_unchecked, FromStr, Utf8Error, Chars};
63+
use crate::vec::Vec;
6464

6565
/// A UTF-8 encoded, growable string.
6666
///

src/liballoc/sync.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ use core::hash::{Hash, Hasher};
2323
use core::{isize, usize};
2424
use core::convert::From;
2525

26-
use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
27-
use boxed::Box;
28-
use rc::is_dangling;
29-
use string::String;
30-
use vec::Vec;
26+
use crate::alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
27+
use crate::boxed::Box;
28+
use crate::rc::is_dangling;
29+
use crate::string::String;
30+
use crate::vec::Vec;
3131

3232
/// A soft limit on the amount of references that may be made to an `Arc`.
3333
///

src/liballoc/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mod if_arc {
1111
use core::marker::PhantomData;
1212
use core::mem;
1313
use core::ptr::{self, NonNull};
14-
use sync::Arc;
14+
use crate::sync::Arc;
1515

1616
/// A way of waking up a specific task.
1717
///

src/liballoc/vec.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ use core::ptr;
7070
use core::ptr::NonNull;
7171
use core::slice;
7272

73-
use collections::CollectionAllocErr;
74-
use borrow::ToOwned;
75-
use borrow::Cow;
76-
use boxed::Box;
77-
use raw_vec::RawVec;
73+
use crate::collections::CollectionAllocErr;
74+
use crate::borrow::ToOwned;
75+
use crate::borrow::Cow;
76+
use crate::boxed::Box;
77+
use crate::raw_vec::RawVec;
7878

7979
/// A contiguous growable array type, written `Vec<T>` but pronounced 'vector'.
8080
///

0 commit comments

Comments
 (0)