Skip to content

Commit 5a2f65f

Browse files
committed
auto merge of #6441 : alexcrichton/rust/issue-5531, r=luqmana
Also fix up all the fallout elsewhere throughout core. It's really nice being able to have the prelude. I'm not quite sure how resolution works with traits, but it seems to me like the public imports at the top-level of the core crate were leaking into the sub-crates, but that could also be working as intended. Regardless, things compile without the re-exports now.
2 parents 3aa1122 + 66e1e51 commit 5a2f65f

34 files changed

+81
-80
lines changed

src/libcore/at_vec.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
//! Managed vectors
1212
1313
use cast::transmute;
14+
use container::Container;
1415
use kinds::Copy;
1516
use old_iter;
17+
use old_iter::BaseIter;
1618
use option::Option;
1719
use sys;
1820
use uint;

src/libcore/comm.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ Message passing
1313
*/
1414

1515
use cast::{transmute, transmute_mut};
16+
use container::Container;
1617
use either::{Either, Left, Right};
1718
use kinds::Owned;
1819
use option::{Option, Some, None};
1920
use uint;
20-
use unstable;
2121
use vec;
22+
use vec::OwnedVector;
2223
use util::replace;
2324
use unstable::sync::{Exclusive, exclusive};
2425

@@ -577,7 +578,7 @@ impl<T:Owned,
577578
#[cfg(test)]
578579
mod test {
579580
use either::Right;
580-
use super::{Chan, Port, oneshot, recv_one, stream};
581+
use super::{Chan, Port, oneshot, stream};
581582
582583
#[test]
583584
fn test_select2() {

src/libcore/core.rc

-42
Original file line numberDiff line numberDiff line change
@@ -68,48 +68,6 @@ they contained the following prologue:
6868
#[cfg(test)] pub use ops = realcore::ops;
6969
#[cfg(test)] pub use cmp = realcore::cmp;
7070

71-
/* Reexported core operators */
72-
73-
pub use kinds::{Const, Copy, Owned};
74-
pub use ops::{Drop};
75-
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
76-
pub use ops::{BitAnd, BitOr, BitXor};
77-
pub use ops::{Shl, Shr, Index};
78-
79-
80-
/* Reexported types and traits */
81-
82-
pub use option::{Option, Some, None};
83-
pub use result::{Result, Ok, Err};
84-
85-
pub use path::Path;
86-
pub use path::GenericPath;
87-
pub use path::WindowsPath;
88-
pub use path::PosixPath;
89-
90-
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
91-
pub use str::{StrSlice};
92-
pub use container::{Container, Mutable};
93-
pub use vec::{CopyableVector, ImmutableVector};
94-
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
95-
pub use vec::{OwnedVector, OwnedCopyableVector, MutableVector};
96-
pub use old_iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
97-
pub use old_iter::{CopyableOrderedIter, CopyableNonstrictIter};
98-
pub use old_iter::{ExtendedMutableIter};
99-
pub use iter::Times;
100-
101-
pub use num::{Num, NumCast};
102-
pub use num::{Orderable, Signed, Unsigned, Round};
103-
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
104-
pub use num::{Integer, Fractional, Real, RealExt};
105-
pub use num::{Bitwise, BitCount, Bounded};
106-
pub use num::{Primitive, Int, Float};
107-
108-
pub use ptr::Ptr;
109-
pub use from_str::FromStr;
110-
pub use to_str::ToStr;
111-
pub use clone::Clone;
112-
11371
// On Linux, link to the runtime with -lrt.
11472
#[cfg(target_os = "linux")]
11573
#[doc(hidden)]

src/libcore/either.rs

+3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010

1111
//! A type that represents one of two alternatives
1212
13+
use container::Container;
1314
use cmp::Eq;
1415
use kinds::Copy;
16+
use old_iter::BaseIter;
1517
use result::Result;
1618
use result;
1719
use vec;
20+
use vec::OwnedVector;
1821

1922
/// The either type
2023
#[deriving(Clone, Eq)]

src/libcore/hash.rs

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
#[cfg(stage0)]
2323
use cast;
24+
use container::Container;
25+
use old_iter::BaseIter;
2426
use rt::io::Writer;
2527
use to_bytes::IterBytes;
2628
use uint;

src/libcore/io.rs

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Basic input/output
1616

1717
use result::Result;
1818

19+
use container::Container;
1920
use int;
2021
use libc;
2122
use libc::{c_int, c_long, c_void, size_t, ssize_t};
@@ -24,11 +25,15 @@ use os;
2425
use cast;
2526
use path::Path;
2627
use ops::Drop;
28+
use old_iter::{BaseIter, CopyableIter};
2729
use ptr;
2830
use result;
2931
use str;
32+
use str::StrSlice;
33+
use to_str::ToStr;
3034
use uint;
3135
use vec;
36+
use vec::{OwnedVector, OwnedCopyableVector};
3237

3338
#[allow(non_camel_case_types)] // not sure what to do about this
3439
pub type fd_t = c_int;

src/libcore/iter.rs

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ much easier to implement.
4242

4343
#[cfg(not(stage0))] use cmp::Ord;
4444
#[cfg(not(stage0))] use option::{Option, Some, None};
45+
#[cfg(not(stage0))] use vec::OwnedVector;
4546

4647
#[cfg(stage0)]
4748
pub trait Times {

src/libcore/logging.rs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub fn console_off() {
4545
#[cfg(not(test))]
4646
#[lang="log_type"]
4747
pub fn log_type<T>(level: u32, object: &T) {
48+
use container::Container;
4849
use cast::transmute;
4950
use io;
5051
use libc;

src/libcore/num/strconv.rs

+3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use container::Container;
1112
use core::cmp::{Ord, Eq};
1213
use ops::{Add, Sub, Mul, Div, Rem, Neg};
1314
use option::{None, Option, Some};
1415
use char;
1516
use str;
1617
use kinds::Copy;
1718
use vec;
19+
use vec::{CopyableVector, ImmutableVector};
20+
use vec::OwnedVector;
1821
use num::{NumCast, Zero, One, cast, pow_with_uint};
1922
use f64;
2023

src/libcore/option.rs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ use util;
4848
use num::Zero;
4949
use old_iter::{BaseIter, MutableIter, ExtendedIter};
5050
use old_iter;
51+
use str::StrSlice;
5152

5253
#[cfg(test)] use str;
5354

src/libcore/path.rs

+4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ Cross-platform file path handling
1414
1515
*/
1616

17+
use container::Container;
1718
use cmp::Eq;
1819
use libc;
1920
use option::{None, Option, Some};
2021
use str;
22+
use str::StrSlice;
2123
use to_str::ToStr;
2224
use ascii::{AsciiCast, AsciiStr};
25+
use old_iter::BaseIter;
26+
use vec::OwnedVector;
2327

2428
#[cfg(windows)]
2529
pub use Path = self::WindowsPath;

src/libcore/pipes.rs

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ bounded and unbounded protocols allows for less code duplication.
8282
8383
*/
8484

85+
use container::Container;
8586
use cast::{forget, transmute, transmute_copy};
8687
use either::{Either, Left, Right};
8788
use kinds::Owned;
@@ -91,8 +92,10 @@ use option::{None, Option, Some};
9192
use unstable::finally::Finally;
9293
use unstable::intrinsics;
9394
use ptr;
95+
use ptr::Ptr;
9496
use task;
9597
use vec;
98+
use vec::OwnedVector;
9699
use util::replace;
97100

98101
static SPIN_COUNT: uint = 0;

src/libcore/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ pub mod ptr_tests {
353353
assert!((p.fst == 50));
354354
assert!((p.snd == 60));
355355
356-
let mut v0 = ~[32000u16, 32001u16, 32002u16];
356+
let v0 = ~[32000u16, 32001u16, 32002u16];
357357
let mut v1 = ~[0u16, 0u16, 0u16];
358358
359359
copy_memory(mut_offset(vec::raw::to_mut_ptr(v1), 1u),

src/libcore/repr.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ use managed;
2525
use ptr;
2626
use reflect;
2727
use reflect::{MovePtr, align};
28+
use str::StrSlice;
2829
use to_str::ToStr;
29-
use vec::UnboxedVecRepr;
3030
use vec::raw::{VecRepr, SliceRepr};
3131
use vec;
32+
use vec::{OwnedVector, UnboxedVecRepr};
3233

3334
#[cfg(test)] use io;
3435

src/libcore/result.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ use either;
1717
use either::Either;
1818
use kinds::Copy;
1919
use option::{None, Option, Some};
20+
use old_iter::BaseIter;
2021
use vec;
22+
use vec::OwnedVector;
2123

2224
/// The result type
2325
#[deriving(Clone, Eq)]

src/libcore/rt/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#[doc(hidden)];
1414

1515
use libc::c_char;
16+
use ptr::Ptr;
1617

1718
#[path = "sched/mod.rs"]
1819
mod sched;

src/libcore/rt/stack.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use container::Container;
12+
use ptr::Ptr;
1113
use vec;
1214

1315
pub struct StackSegment {

src/libcore/rt/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn spawntask_try(f: ~fn()) -> Result<(), ()> {
7777

7878
// Switch to the scheduler
7979
let f = Cell(Cell(f));
80-
let mut sched = local_sched::take();
80+
let sched = local_sched::take();
8181
do sched.deschedule_running_task_and_then() |old_task| {
8282
let old_task = Cell(old_task);
8383
let f = f.take();

src/libcore/rt/uv/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ via `close` and `delete` methods.
3434
3535
*/
3636

37+
use container::Container;
3738
use option::*;
3839
use str::raw::from_c_str;
3940
use to_str::ToStr;
4041
use vec;
4142
use ptr;
43+
use ptr::Ptr;
4244
use libc::{c_void, c_int, size_t, malloc, free};
4345
use cast::transmute;
4446
use ptr::null;

src/libcore/rt/uv/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ fn listen() {
388388
assert!(status.is_none());
389389
let mut server_stream_watcher = server_stream_watcher;
390390
let mut loop_ = loop_;
391-
let mut client_tcp_watcher = TcpWatcher::new(&mut loop_);
391+
let client_tcp_watcher = TcpWatcher::new(&mut loop_);
392392
let mut client_tcp_watcher = client_tcp_watcher.as_stream();
393393
server_stream_watcher.accept(client_tcp_watcher);
394394
let count_cell = Cell(0);

src/libcore/rt/uvio.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ use super::io::net::ip::IpAddr;
1515
use super::uv::*;
1616
use super::rtio::*;
1717
use ops::Drop;
18+
use old_iter::CopyableIter;
1819
use cell::{Cell, empty_cell};
1920
use cast::transmute;
2021
use super::sched::{Scheduler, local_sched};
2122

23+
#[cfg(test)] use container::Container;
2224
#[cfg(test)] use uint;
2325
#[cfg(test)] use unstable::run_in_bare_thread;
2426
#[cfg(test)] use super::test::*;
@@ -426,7 +428,7 @@ fn test_read_read_read() {
426428
let io = local_sched::unsafe_borrow_io();
427429
let mut listener = io.bind(addr).unwrap();
428430
let mut stream = listener.listen().unwrap();
429-
let mut buf = [1, .. 2048];
431+
let buf = [1, .. 2048];
430432
let mut total_bytes_written = 0;
431433
while total_bytes_written < MAX {
432434
stream.write(buf);

src/libcore/rt/work_queue.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use container::Container;
1112
use option::*;
13+
use vec::OwnedVector;
1214

1315
pub struct WorkQueue<T> {
1416
priv queue: ~[T]

src/libcore/run.rs

-1
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,6 @@ pub fn waitpid(pid: pid_t) -> int {
778778

779779
#[cfg(test)]
780780
mod tests {
781-
use libc;
782781
use option::None;
783782
use os;
784783
use run::{readclose, writeclose};

src/libcore/str.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@ use cast;
2323
use char;
2424
use clone::Clone;
2525
use cmp::{TotalOrd, Ordering, Less, Equal, Greater};
26+
use container::Container;
27+
use iter::Times;
28+
use iterator::Iterator;
2629
use libc;
2730
use option::{None, Option, Some};
28-
use iterator::Iterator;
31+
use old_iter::{BaseIter, EqIter};
2932
use ptr;
33+
use ptr::Ptr;
3034
use str;
35+
use to_str::ToStr;
3136
use uint;
3237
use vec;
33-
use to_str::ToStr;
38+
use vec::{OwnedVector, OwnedCopyableVector};
3439

3540
#[cfg(not(test))] use cmp::{Eq, Ord, Equiv, TotalEq};
3641

@@ -3133,13 +3138,16 @@ impl<'self> Iterator<char> for StrCharIterator<'self> {
31333138
31343139
#[cfg(test)]
31353140
mod tests {
3141+
use container::Container;
31363142
use char;
31373143
use option::Some;
31383144
use libc::c_char;
31393145
use libc;
3146+
use old_iter::BaseIter;
31403147
use ptr;
31413148
use str::*;
31423149
use vec;
3150+
use vec::ImmutableVector;
31433151
use cmp::{TotalOrd, Less, Equal, Greater};
31443152
31453153
#[test]

src/libcore/str/ascii.rs

+3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
1313
use to_str::{ToStr,ToStrConsume};
1414
use str;
15+
use str::StrSlice;
1516
use cast;
17+
use old_iter::BaseIter;
18+
use vec::{CopyableVector, ImmutableVector, OwnedVector};
1619

1720
/// Datatype to hold one ascii character. It is 8 bit long.
1821
#[deriving(Clone, Eq)]

src/libcore/task/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ fn test_add_wrapper() {
772772
do b0.add_wrapper |body| {
773773
let ch = Cell(ch.take());
774774
let result: ~fn() = || {
775-
let mut ch = ch.take();
775+
let ch = ch.take();
776776
body();
777777
ch.send(());
778778
};

src/libcore/task/spawn.rs

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ use cell::Cell;
7878
use container::Map;
7979
use comm::{Chan, GenericChan};
8080
use prelude::*;
81-
use unstable;
8281
use ptr;
8382
use hashmap::HashSet;
8483
use task::local_data_priv::{local_get, local_set, OldHandle};

0 commit comments

Comments
 (0)