Skip to content

Commit e2ad3be

Browse files
committed
Use #[prelude_import] in libcore.
1 parent 308824a commit e2ad3be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+30
-183
lines changed

src/libcore/any.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,10 @@
7272
#![stable(feature = "rust1", since = "1.0.0")]
7373

7474
use fmt;
75-
use marker::Send;
7675
use mem::transmute;
77-
use option::Option::{self, Some, None};
7876
use raw::TraitObject;
7977
use intrinsics;
80-
use marker::{Reflect, Sized};
78+
use marker::Reflect;
8179

8280
///////////////////////////////////////////////////////////////////////////////
8381
// Any trait

src/libcore/array.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,11 @@
2020
issue = "27778")]
2121

2222
use borrow::{Borrow, BorrowMut};
23-
use clone::Clone;
24-
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
25-
use convert::{AsRef, AsMut};
26-
use default::Default;
23+
use cmp::Ordering;
2724
use fmt;
2825
use hash::{Hash, self};
29-
use iter::IntoIterator;
30-
use marker::{Copy, Sized, Unsize};
31-
use option::Option;
32-
use slice::{Iter, IterMut, SliceExt};
26+
use marker::Unsize;
27+
use slice::{Iter, IterMut};
3328

3429
/// Utility trait implemented only on arrays of fixed size
3530
///

src/libcore/borrow.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
1313
#![stable(feature = "rust1", since = "1.0.0")]
1414

15-
use marker::Sized;
16-
1715
/// A trait for borrowing data.
1816
///
1917
/// In general, there may be several ways to "borrow" a piece of data. The

src/libcore/cell.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,10 @@
144144
145145
#![stable(feature = "rust1", since = "1.0.0")]
146146

147-
use clone::Clone;
148-
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
149-
use convert::From;
150-
use default::Default;
147+
use cmp::Ordering;
151148
use fmt::{self, Debug, Display};
152-
use marker::{Copy, PhantomData, Send, Sync, Sized, Unsize};
153-
use ops::{Deref, DerefMut, Drop, FnOnce, CoerceUnsized};
154-
use option::Option;
155-
use option::Option::{None, Some};
156-
use result::Result;
157-
use result::Result::{Ok, Err};
149+
use marker::{PhantomData, Unsize};
150+
use ops::{Deref, DerefMut, CoerceUnsized};
158151

159152
/// A mutable memory location that admits only `Copy` data.
160153
///

src/libcore/char.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#![allow(non_snake_case)]
1616
#![stable(feature = "core_char", since = "1.2.0")]
1717

18-
use prelude::v1::*;
19-
2018
use char_private::is_printable;
2119
use iter::FusedIterator;
2220
use mem::transmute;

src/libcore/char_private.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// NOTE: The following code was generated by "src/etc/char_private.py",
1212
// do not edit directly!
1313

14-
use slice::SliceExt;
15-
1614
fn check(x: u16, singletons: &[u16], normal: &[u16]) -> bool {
1715
for &s in singletons {
1816
if x == s {

src/libcore/clone.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
4545
#![stable(feature = "rust1", since = "1.0.0")]
4646

47-
use marker::Sized;
48-
4947
/// A common trait for the ability to explicitly duplicate an object.
5048
///
5149
/// Differs from `Copy` in that `Copy` is implicit and extremely inexpensive, while

src/libcore/cmp.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434

3535
use self::Ordering::*;
3636

37-
use marker::Sized;
38-
use option::Option::{self, Some};
39-
4037
/// Trait for equality comparisons which are [partial equivalence
4138
/// relations](http://en.wikipedia.org/wiki/Partial_equivalence_relation).
4239
///
@@ -571,11 +568,7 @@ pub fn max<T: Ord>(v1: T, v2: T) -> T {
571568

572569
// Implementation of PartialEq, Eq, PartialOrd and Ord for primitive types
573570
mod impls {
574-
use cmp::{PartialOrd, Ord, PartialEq, Eq, Ordering};
575-
use cmp::Ordering::{Less, Greater, Equal};
576-
use marker::Sized;
577-
use option::Option;
578-
use option::Option::{Some, None};
571+
use cmp::Ordering::{self, Less, Greater, Equal};
579572

580573
macro_rules! partial_eq_impl {
581574
($($t:ty)*) => ($(

src/libcore/convert.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
4141
#![stable(feature = "rust1", since = "1.0.0")]
4242

43-
use marker::Sized;
44-
use result::Result;
45-
4643
/// A cheap, reference-to-reference conversion.
4744
///
4845
/// `AsRef` is very similar to, but different than, `Borrow`. See

src/libcore/default.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
1313
#![stable(feature = "rust1", since = "1.0.0")]
1414

15-
use marker::Sized;
16-
1715
/// A trait for giving a type a useful default value.
1816
///
1917
/// Sometimes, you want to fall back to some kind of default value, and

0 commit comments

Comments
 (0)