Skip to content

Move stray lang items from core::rt to core::unstable::lang #5191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libcore/at_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn debug_mem() -> bool {
#[cfg(notest)]
#[lang="annihilate"]
pub unsafe fn annihilate() {
use rt::local_free;
use unstable::lang::local_free;
use io::WriterUtil;
use io;
use libc;
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -242,7 +242,7 @@ impl<T: Owned> Peekable<T> for PortSet<T> {
}

/// A channel that can be shared between many senders.
pub type SharedChan<T> = private::Exclusive<Chan<T>>;
pub type SharedChan<T> = unstable::Exclusive<Chan<T>>;

impl<T: Owned> GenericChan<T> for SharedChan<T> {
fn send(x: T) {
Expand All @@ -268,7 +268,7 @@ impl<T: Owned> GenericSmartChan<T> for SharedChan<T> {

/// Converts a `chan` into a `shared_chan`.
pub fn SharedChan<T:Owned>(c: Chan<T>) -> SharedChan<T> {
private::exclusive(c)
unstable::exclusive(c)
}

/// Receive a message from one of two endpoints.
Expand Down
10 changes: 6 additions & 4 deletions src/libcore/core.rc
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,13 @@ pub const debug : u32 = 4_u32;

/* Unsupported interfaces */

// The runtime interface used by the compiler
#[cfg(notest)] pub mod rt;
// Private APIs
pub mod private;

pub mod unstable;
// NOTE: Remove after snapshot
#[cfg(stage0)]
pub mod private {
pub use super::unstable::extfmt;
}

/* For internal use, not exported */

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions src/libcore/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<T>(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<SharedValue>;
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions src/libcore/task/local_data_priv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ use prelude::*;
use task::rt;
use task::local_data::LocalDataKey;

#[cfg(notest)]
use rt::rust_task;
#[cfg(test)]
#[allow(non_camel_case_types)]
type rust_task = libc::c_void;
use super::rt::rust_task;

pub trait LocalData { }
impl<T:Durable> LocalData for @T { }
Expand Down
14 changes: 7 additions & 7 deletions src/libcore/task/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -123,7 +123,7 @@ struct TaskGroupData {
// tasks in this group.
mut descendants: TaskSet,
}
type TaskGroupArc = private::Exclusive<Option<TaskGroupData>>;
type TaskGroupArc = unstable::Exclusive<Option<TaskGroupData>>;

type TaskGroupInner = &mut Option<TaskGroupData>;

Expand Down Expand Up @@ -153,7 +153,7 @@ struct AncestorNode {
mut ancestors: AncestorList,
}

enum AncestorList = Option<private::Exclusive<AncestorNode>>;
enum AncestorList = Option<unstable::Exclusive<AncestorNode>>;

// Accessors for taskgroup arcs and ancestor arcs that wrap the unsafety.
#[inline(always)]
Expand All @@ -162,7 +162,7 @@ fn access_group<U>(x: &TaskGroupArc, blk: fn(TaskGroupInner) -> U) -> U {
}

#[inline(always)]
fn access_ancestors<U>(x: &private::Exclusive<AncestorNode>,
fn access_ancestors<U>(x: &unstable::Exclusive<AncestorNode>,
blk: fn(x: &mut AncestorNode) -> U) -> U {
unsafe { x.with(blk) }
}
Expand Down Expand Up @@ -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(),
}));
Expand All @@ -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(),
}));
Expand All @@ -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,
Expand Down
19 changes: 11 additions & 8 deletions src/libcore/private.rs → src/libcore/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ 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;
#[path = "unstable/lang.rs"]
#[cfg(notest)]
pub mod lang;

extern mod rustrt {
pub unsafe fn rust_create_little_lock() -> rust_little_lock;
Expand Down Expand Up @@ -312,7 +315,7 @@ pub mod tests {
use cell::Cell;
use comm;
use option;
use private::exclusive;
use super::exclusive;
use result;
use task;
use uint;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/libcore/private/global.rs → src/libcore/unstable/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
File renamed without changes.
5 changes: 1 addition & 4 deletions src/libcore/rt.rs → src/libcore/unstable/lang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ 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};

#[allow(non_camel_case_types)]
pub type rust_task = c_void;

#[cfg(target_word_size = "32")]
pub const FROZEN_BIT: uint = 0x80000000;
#[cfg(target_word_size = "64")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
8 changes: 4 additions & 4 deletions src/libcore/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/uv_global_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/ext/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/noncopyable-match-pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/alt-ref-binding-in-guard-3256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Loading