diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-05 14:44:37 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-07 13:00:52 -0700 |
| commit | de7d1431760c788e5a471194fa85675033d0ed72 (patch) | |
| tree | 2ece65f6d02061b9ed83dc19a20dc2a5401374d0 /src/libstd/rt | |
| parent | 439e2770be6aec41a3961235305787a78d47fbdd (diff) | |
| download | rust-de7d1431760c788e5a471194fa85675033d0ed72.tar.gz rust-de7d1431760c788e5a471194fa85675033d0ed72.zip | |
Fix existing privacy/visibility violations
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/io/buffered.rs | 5 | ||||
| -rw-r--r-- | src/libstd/rt/io/mod.rs | 3 | ||||
| -rw-r--r-- | src/libstd/rt/mod.rs | 17 | ||||
| -rw-r--r-- | src/libstd/rt/sched.rs | 6 |
4 files changed, 26 insertions, 5 deletions
diff --git a/src/libstd/rt/io/buffered.rs b/src/libstd/rt/io/buffered.rs index a8cf8151499..2269469ee23 100644 --- a/src/libstd/rt/io/buffered.rs +++ b/src/libstd/rt/io/buffered.rs @@ -335,14 +335,15 @@ mod test { // newtype struct autoderef weirdness #[test] fn test_buffered_stream() { + use rt; struct S; - impl Writer for S { + impl rt::io::Writer for S { fn write(&mut self, _: &[u8]) {} fn flush(&mut self) {} } - impl Reader for S { + impl rt::io::Reader for S { fn read(&mut self, _: &mut [u8]) -> Option<uint> { None } fn eof(&mut self) -> bool { true } } diff --git a/src/libstd/rt/io/mod.rs b/src/libstd/rt/io/mod.rs index c2f137ba119..a18f97930fa 100644 --- a/src/libstd/rt/io/mod.rs +++ b/src/libstd/rt/io/mod.rs @@ -300,7 +300,8 @@ pub mod comm_adapters; mod extensions; /// Non-I/O things needed by the I/O module -mod support; +// XXX: shouldn this really be pub? +pub mod support; /// Basic Timer pub mod timer; diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 2ece2800cf2..c7c4d3fc4f6 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -67,14 +67,27 @@ use rt::local::Local; use rt::sched::{Scheduler, Shutdown}; use rt::sleeper_list::SleeperList; use rt::task::{Task, SchedTask, GreenTask, Sched}; -use rt::thread::Thread; -use rt::work_queue::WorkQueue; use rt::uv::uvio::UvEventLoop; use unstable::atomics::{AtomicInt, SeqCst}; use unstable::sync::UnsafeArc; use vec; use vec::{OwnedVector, MutableVector, ImmutableVector}; +use self::thread::Thread; +use self::work_queue::WorkQueue; + +// XXX: these probably shouldn't be public... +#[doc(hidden)] +pub mod shouldnt_be_public { + pub use super::sched::Scheduler; + pub use super::kill::KillHandle; + pub use super::thread::Thread; + pub use super::work_queue::WorkQueue; + pub use super::select::SelectInner; + pub use super::rtio::EventLoop; + pub use super::select::{SelectInner, SelectPortInner}; +} + /// The global (exchange) heap. pub mod global_heap; diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index bddcb700433..cbffec51cc9 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -803,6 +803,12 @@ impl SchedHandle { self.queue.push(msg); self.remote.fire(); } + pub fn send_task_from_friend(&mut self, friend: ~Task) { + self.send(TaskFromFriend(friend)); + } + pub fn send_shutdown(&mut self) { + self.send(Shutdown); + } } struct CleanupJob { |
