From 9e320b967354a1f78cd2d53d13b827fa6ef111fa Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 27 Feb 2013 19:53:31 -0800 Subject: [PATCH] Rename core::private to core::unstable. #4743 --- src/libcore/at_vec.rs | 2 +- src/libcore/comm.rs | 6 +++--- src/libcore/core.rc | 2 +- src/libcore/num/f32.rs | 2 +- src/libcore/num/f64.rs | 2 +- src/libcore/os.rs | 5 ++--- src/libcore/pipes.rs | 4 ++-- src/libcore/prelude.rs | 2 +- src/libcore/ptr.rs | 2 +- src/libcore/rt.rs | 2 +- src/libcore/task/spawn.rs | 14 +++++++------- src/libcore/{private.rs => unstable.rs} | 16 ++++++++-------- src/libcore/{private => unstable}/at_exit.rs | 0 .../{private => unstable}/exchange_alloc.rs | 2 +- src/libcore/{private => unstable}/extfmt.rs | 0 src/libcore/{private => unstable}/finally.rs | 0 src/libcore/{private => unstable}/global.rs | 10 +++++----- src/libcore/{private => unstable}/intrinsics.rs | 0 src/libcore/{private => unstable}/weak_task.rs | 6 +++--- src/libcore/vec.rs | 8 ++++---- src/libstd/arc.rs | 6 +++--- src/libstd/sync.rs | 2 +- src/libstd/uv_global_loop.rs | 4 ++-- src/libsyntax/ext/fmt.rs | 4 ++-- .../compile-fail/noncopyable-match-pattern.rs | 2 +- .../run-pass/alt-ref-binding-in-guard-3256.rs | 2 +- src/test/run-pass/foreign-call-no-runtime.rs | 2 +- src/test/run-pass/type-use-i1-versus-i8.rs | 2 +- 28 files changed, 54 insertions(+), 55 deletions(-) rename src/libcore/{private.rs => unstable.rs} (97%) rename src/libcore/{private => unstable}/at_exit.rs (100%) rename src/libcore/{private => unstable}/exchange_alloc.rs (97%) rename src/libcore/{private => unstable}/extfmt.rs (100%) rename src/libcore/{private => unstable}/finally.rs (100%) rename src/libcore/{private => unstable}/global.rs (97%) rename src/libcore/{private => unstable}/intrinsics.rs (100%) rename src/libcore/{private => unstable}/weak_task.rs (97%) diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs index ab604d1f0b6f..d89481766c0a 100644 --- a/src/libcore/at_vec.rs +++ b/src/libcore/at_vec.rs @@ -183,7 +183,7 @@ pub mod raw { use at_vec::{capacity, rustrt}; use cast::transmute; use libc; - use private::intrinsics::{move_val_init}; + use unstable::intrinsics::{move_val_init}; use ptr::addr_of; use ptr; use sys; diff --git a/src/libcore/comm.rs b/src/libcore/comm.rs index 238207f12b63..94272f63e672 100644 --- a/src/libcore/comm.rs +++ b/src/libcore/comm.rs @@ -12,7 +12,7 @@ use either::{Either, Left, Right}; use kinds::Owned; use option; use option::{Option, Some, None, unwrap}; -use private; +use unstable; use vec; use pipes::{recv, try_recv, wait_many, peek, PacketHeader}; @@ -242,7 +242,7 @@ impl Peekable for PortSet { } /// A channel that can be shared between many senders. -pub type SharedChan = private::Exclusive>; +pub type SharedChan = unstable::Exclusive>; impl GenericChan for SharedChan { fn send(x: T) { @@ -268,7 +268,7 @@ impl GenericSmartChan for SharedChan { /// Converts a `chan` into a `shared_chan`. pub fn SharedChan(c: Chan) -> SharedChan { - private::exclusive(c) + unstable::exclusive(c) } /// Receive a message from one of two endpoints. diff --git a/src/libcore/core.rc b/src/libcore/core.rc index 3e514ce249ff..4917cdbf1e69 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -228,7 +228,7 @@ pub const debug : u32 = 4_u32; // The runtime interface used by the compiler #[cfg(notest)] pub mod rt; // Private APIs -pub mod private; +pub mod unstable; /* For internal use, not exported */ diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index c4f2704ab9f6..d4808bd111ff 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -18,7 +18,7 @@ use num::strconv; use num; use ops; use option::Option; -use private::intrinsics::floorf32; +use unstable::intrinsics::floorf32; use from_str; use to_str; diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index 8f3771312e4d..5362a65f7cef 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -19,7 +19,7 @@ use num::strconv; use num; use ops; use option::Option; -use private::intrinsics::floorf64; +use unstable::intrinsics::floorf64; use to_str; use from_str; diff --git a/src/libcore/os.rs b/src/libcore/os.rs index 8b6d27496d90..5ede0c550ffe 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -35,7 +35,6 @@ use libc::{mode_t, pid_t, FILE}; use option; use option::{Some, None}; use prelude::*; -use private; use ptr; use str; use task; @@ -145,8 +144,8 @@ This uses a per-runtime lock to serialize access. FIXME #4726: It would probably be appropriate to make this a real global */ fn with_env_lock(f: &fn() -> T) -> T { - use private::global::global_data_clone_create; - use private::{Exclusive, exclusive}; + use unstable::global::global_data_clone_create; + use unstable::{Exclusive, exclusive}; struct SharedValue(()); type ValueMutex = Exclusive; diff --git a/src/libcore/pipes.rs b/src/libcore/pipes.rs index 77554656913c..58ab2ce78f5f 100644 --- a/src/libcore/pipes.rs +++ b/src/libcore/pipes.rs @@ -91,9 +91,9 @@ use libc; use option; use option::{None, Option, Some, unwrap}; use pipes; -use private::intrinsics; +use unstable::intrinsics; use ptr; -use private; +use unstable; use task; use vec; diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs index d0a16f7875b5..422d9a6eea0a 100644 --- a/src/libcore/prelude.rs +++ b/src/libcore/prelude.rs @@ -69,7 +69,7 @@ pub use option; pub use os; pub use path; pub use comm; -pub use private; +pub use unstable; pub use ptr; pub use rand; pub use result; diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 2266c2511f8f..5a7b319e7ff3 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -14,7 +14,7 @@ use cast; use cmp::{Eq, Ord}; use libc; use libc::{c_void, size_t}; -use private::intrinsics::{memmove32,memmove64}; +use unstable::intrinsics::{memmove32,memmove64}; use ptr; use str; use sys; diff --git a/src/libcore/rt.rs b/src/libcore/rt.rs index 5d0bad3ceb3c..a4f90e37683e 100644 --- a/src/libcore/rt.rs +++ b/src/libcore/rt.rs @@ -15,7 +15,7 @@ use libc::{c_char, c_uchar, c_void, size_t, uintptr_t, c_int}; use managed::raw::BoxRepr; use str; use sys; -use private::exchange_alloc; +use unstable::exchange_alloc; use cast::transmute; use gc::{cleanup_stack_for_failure, gc, Word}; diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs index bf7209f9fc3f..6cc3657a32b4 100644 --- a/src/libcore/task/spawn.rs +++ b/src/libcore/task/spawn.rs @@ -79,7 +79,7 @@ use option; use comm::{Chan, GenericChan, GenericPort, Port, stream}; use pipes; use prelude::*; -use private; +use unstable; use ptr; use hashmap::linear::LinearSet; use task::local_data_priv::{local_get, local_set}; @@ -123,7 +123,7 @@ struct TaskGroupData { // tasks in this group. mut descendants: TaskSet, } -type TaskGroupArc = private::Exclusive>; +type TaskGroupArc = unstable::Exclusive>; type TaskGroupInner = &mut Option; @@ -153,7 +153,7 @@ struct AncestorNode { mut ancestors: AncestorList, } -enum AncestorList = Option>; +enum AncestorList = Option>; // Accessors for taskgroup arcs and ancestor arcs that wrap the unsafety. #[inline(always)] @@ -162,7 +162,7 @@ fn access_group(x: &TaskGroupArc, blk: fn(TaskGroupInner) -> U) -> U { } #[inline(always)] -fn access_ancestors(x: &private::Exclusive, +fn access_ancestors(x: &unstable::Exclusive, blk: fn(x: &mut AncestorNode) -> U) -> U { unsafe { x.with(blk) } } @@ -458,7 +458,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool) // Main task, doing first spawn ever. Lazily initialise here. let mut members = new_taskset(); taskset_insert(&mut members, spawner); - let tasks = private::exclusive(Some(TaskGroupData { + let tasks = unstable::exclusive(Some(TaskGroupData { members: members, descendants: new_taskset(), })); @@ -482,7 +482,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool) (g, a, spawner_group.is_main) } else { // Child is in a separate group from spawner. - let g = private::exclusive(Some(TaskGroupData { + let g = unstable::exclusive(Some(TaskGroupData { members: new_taskset(), descendants: new_taskset(), })); @@ -502,7 +502,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool) }; assert new_generation < uint::max_value; // Build a new node in the ancestor list. - AncestorList(Some(private::exclusive(AncestorNode { + AncestorList(Some(unstable::exclusive(AncestorNode { generation: new_generation, parent_group: Some(spawner_group.tasks.clone()), ancestors: old_ancestors, diff --git a/src/libcore/private.rs b/src/libcore/unstable.rs similarity index 97% rename from src/libcore/private.rs rename to src/libcore/unstable.rs index d19951e76dbd..b7b4b5634252 100644 --- a/src/libcore/private.rs +++ b/src/libcore/unstable.rs @@ -22,19 +22,19 @@ use task; use task::{TaskBuilder, atomically}; use uint; -#[path = "private/at_exit.rs"] +#[path = "unstable/at_exit.rs"] pub mod at_exit; -#[path = "private/global.rs"] +#[path = "unstable/global.rs"] pub mod global; -#[path = "private/finally.rs"] +#[path = "unstable/finally.rs"] pub mod finally; -#[path = "private/weak_task.rs"] +#[path = "unstable/weak_task.rs"] pub mod weak_task; -#[path = "private/exchange_alloc.rs"] +#[path = "unstable/exchange_alloc.rs"] pub mod exchange_alloc; -#[path = "private/intrinsics.rs"] +#[path = "unstable/intrinsics.rs"] pub mod intrinsics; -#[path = "private/extfmt.rs"] +#[path = "unstable/extfmt.rs"] pub mod extfmt; extern mod rustrt { @@ -312,7 +312,7 @@ pub mod tests { use cell::Cell; use comm; use option; - use private::exclusive; + use super::exclusive; use result; use task; use uint; diff --git a/src/libcore/private/at_exit.rs b/src/libcore/unstable/at_exit.rs similarity index 100% rename from src/libcore/private/at_exit.rs rename to src/libcore/unstable/at_exit.rs diff --git a/src/libcore/private/exchange_alloc.rs b/src/libcore/unstable/exchange_alloc.rs similarity index 97% rename from src/libcore/private/exchange_alloc.rs rename to src/libcore/unstable/exchange_alloc.rs index b6af9891e118..f59037445ebd 100644 --- a/src/libcore/private/exchange_alloc.rs +++ b/src/libcore/unstable/exchange_alloc.rs @@ -14,7 +14,7 @@ use c_malloc = libc::malloc; use c_free = libc::free; use managed::raw::{BoxHeaderRepr, BoxRepr}; use cast::transmute; -use private::intrinsics::{atomic_xadd,atomic_xsub}; +use unstable::intrinsics::{atomic_xadd,atomic_xsub}; use ptr::null; use intrinsic::TyDesc; diff --git a/src/libcore/private/extfmt.rs b/src/libcore/unstable/extfmt.rs similarity index 100% rename from src/libcore/private/extfmt.rs rename to src/libcore/unstable/extfmt.rs diff --git a/src/libcore/private/finally.rs b/src/libcore/unstable/finally.rs similarity index 100% rename from src/libcore/private/finally.rs rename to src/libcore/unstable/finally.rs diff --git a/src/libcore/private/global.rs b/src/libcore/unstable/global.rs similarity index 97% rename from src/libcore/private/global.rs rename to src/libcore/unstable/global.rs index 77b61347250d..aa28310f7ba2 100644 --- a/src/libcore/private/global.rs +++ b/src/libcore/unstable/global.rs @@ -32,11 +32,11 @@ use libc::{c_void, uintptr_t}; use option::{Option, Some, None}; use ops::Drop; use pipes; -use private::{Exclusive, exclusive}; -use private::{SharedMutableState, shared_mutable_state}; -use private::{get_shared_immutable_state}; -use private::at_exit::at_exit; -use private::intrinsics::atomic_cxchg; +use unstable::{Exclusive, exclusive}; +use unstable::{SharedMutableState, shared_mutable_state}; +use unstable::{get_shared_immutable_state}; +use unstable::at_exit::at_exit; +use unstable::intrinsics::atomic_cxchg; use hashmap::linear::LinearMap; use sys::Closure; use task::spawn; diff --git a/src/libcore/private/intrinsics.rs b/src/libcore/unstable/intrinsics.rs similarity index 100% rename from src/libcore/private/intrinsics.rs rename to src/libcore/unstable/intrinsics.rs diff --git a/src/libcore/private/weak_task.rs b/src/libcore/unstable/weak_task.rs similarity index 97% rename from src/libcore/private/weak_task.rs rename to src/libcore/unstable/weak_task.rs index 8445638850cd..0e1181f43dbc 100644 --- a/src/libcore/private/weak_task.rs +++ b/src/libcore/unstable/weak_task.rs @@ -24,9 +24,9 @@ use comm::{Port, Chan, SharedChan, GenericChan, GenericPort}; use hashmap::linear::LinearMap; use ops::Drop; use option::{Some, None, swap_unwrap}; -use private::at_exit::at_exit; -use private::finally::Finally; -use private::global::global_data_clone_create; +use unstable::at_exit::at_exit; +use unstable::finally::Finally; +use unstable::global::global_data_clone_create; use task::rt::{task_id, get_task_id}; use task::{Task, task, spawn}; diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 4d28c769b184..0d1be03638af 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -22,7 +22,7 @@ use kinds::Copy; use libc; use libc::size_t; use option::{None, Option, Some}; -use private::intrinsics; +use unstable::intrinsics; use ptr; use ptr::addr_of; use sys; @@ -2008,7 +2008,7 @@ pub mod raw { use managed; use option::{None, Some}; use option; - use private::intrinsics; + use unstable::intrinsics; use ptr::addr_of; use ptr; use sys; @@ -2622,8 +2622,8 @@ mod tests { #[test] fn test_swap_remove_noncopyable() { // Tests that we don't accidentally run destructors twice. - let mut v = ~[::private::exclusive(()), ::private::exclusive(()), - ::private::exclusive(())]; + let mut v = ~[::unstable::exclusive(()), ::unstable::exclusive(()), + ::unstable::exclusive(())]; let mut _e = v.swap_remove(0); assert (len(v) == 2); _e = v.swap_remove(1); diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 69c5026cbd1f..ea59d6a54c6d 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -20,9 +20,9 @@ use core::cast; use core::cell::Cell; use core::pipes; use core::prelude::*; -use core::private::{SharedMutableState, shared_mutable_state}; -use core::private::{clone_shared_mutable_state}; -use core::private::{get_shared_mutable_state, get_shared_immutable_state}; +use core::unstable::{SharedMutableState, shared_mutable_state}; +use core::unstable::{clone_shared_mutable_state}; +use core::unstable::{get_shared_mutable_state, get_shared_immutable_state}; use core::ptr; use core::task; use core::util; diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 39d3fd569a62..1289bc8e889c 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -19,7 +19,7 @@ use core::cell::Cell; use core::option; use core::pipes; use core::prelude::*; -use core::private::{Exclusive, exclusive}; +use core::unstable::{Exclusive, exclusive}; use core::ptr; use core::task; use core::util; diff --git a/src/libstd/uv_global_loop.rs b/src/libstd/uv_global_loop.rs index 37d9b3221b2d..52cfc078bace 100644 --- a/src/libstd/uv_global_loop.rs +++ b/src/libstd/uv_global_loop.rs @@ -18,9 +18,9 @@ use uv_iotask::{IoTask, spawn_iotask}; use core::either::{Left, Right}; use core::libc; use core::comm::{Port, Chan, SharedChan, select2i}; -use core::private::global::{global_data_clone_create, +use core::unstable::global::{global_data_clone_create, global_data_clone}; -use core::private::weak_task::weaken_task; +use core::unstable::weak_task::weaken_task; use core::str; use core::task::{task, SingleThreaded, spawn}; use core::task; diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index b8781130562b..3861db28e1d9 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -24,7 +24,7 @@ use ext::base::*; use ext::base; use ext::build; use ext::build::*; -use private::extfmt::ct::*; +use unstable::extfmt::ct::*; pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: ~[ast::token_tree]) -> base::MacResult { @@ -57,7 +57,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, -> @ast::expr { fn make_path_vec(cx: ext_ctxt, ident: @~str) -> ~[ast::ident] { let intr = cx.parse_sess().interner; - return ~[intr.intern(@~"private"), intr.intern(@~"extfmt"), + return ~[intr.intern(@~"unstable"), intr.intern(@~"extfmt"), intr.intern(@~"rt"), intr.intern(ident)]; } fn make_rt_path_expr(cx: ext_ctxt, sp: span, nm: @~str) -> @ast::expr { diff --git a/src/test/compile-fail/noncopyable-match-pattern.rs b/src/test/compile-fail/noncopyable-match-pattern.rs index 9f21d5a647ae..d90e2f372a84 100644 --- a/src/test/compile-fail/noncopyable-match-pattern.rs +++ b/src/test/compile-fail/noncopyable-match-pattern.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - let x = Some(private::exclusive(false)); + let x = Some(unstable::exclusive(false)); match x { Some(copy z) => { //~ ERROR copying a value of non-copyable type do z.with |b| { assert !*b; } diff --git a/src/test/run-pass/alt-ref-binding-in-guard-3256.rs b/src/test/run-pass/alt-ref-binding-in-guard-3256.rs index 4474aec3d2e5..d9c348cf9933 100644 --- a/src/test/run-pass/alt-ref-binding-in-guard-3256.rs +++ b/src/test/run-pass/alt-ref-binding-in-guard-3256.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = Some(private::exclusive(true)); + let x = Some(unstable::exclusive(true)); match x { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert *b; } diff --git a/src/test/run-pass/foreign-call-no-runtime.rs b/src/test/run-pass/foreign-call-no-runtime.rs index 5d400e98d41a..86f23dd5210d 100644 --- a/src/test/run-pass/foreign-call-no-runtime.rs +++ b/src/test/run-pass/foreign-call-no-runtime.rs @@ -1,4 +1,4 @@ -use core::private::run_in_bare_thread; +use core::unstable::run_in_bare_thread; extern { pub fn rust_dbg_call(cb: *u8, diff --git a/src/test/run-pass/type-use-i1-versus-i8.rs b/src/test/run-pass/type-use-i1-versus-i8.rs index d16b2e3e996c..d180f6c72604 100644 --- a/src/test/run-pass/type-use-i1-versus-i8.rs +++ b/src/test/run-pass/type-use-i1-versus-i8.rs @@ -11,5 +11,5 @@ pub fn main() { let mut x: bool = false; // this line breaks it - private::intrinsics::move_val_init(&mut x, false); + unstable::intrinsics::move_val_init(&mut x, false); }