std: Remove old magic core mod

This commit is contained in:
Brian Anderson
2013-07-19 17:32:08 -07:00
committed by Daniel Micay
parent 8d64fa3288
commit ddd8c156c6
6 changed files with 32 additions and 42 deletions

View File

@@ -21,7 +21,7 @@ the `clone` method.
*/
use core::kinds::Freeze;
use std::kinds::Freeze;
/// A common trait for cloning an object.
pub trait Clone {

View File

@@ -382,19 +382,19 @@ mod pipesy {
#[allow(non_camel_case_types)]
pub mod oneshot {
priv use core::kinds::Send;
priv use std::kinds::Send;
use ptr::to_mut_unsafe_ptr;
pub fn init<T: Send>() -> (server::Oneshot<T>, client::Oneshot<T>) {
pub use core::pipes::HasBuffer;
pub use std::pipes::HasBuffer;
let buffer = ~::core::pipes::Buffer {
header: ::core::pipes::BufferHeader(),
let buffer = ~::std::pipes::Buffer {
header: ::std::pipes::BufferHeader(),
data: __Buffer {
Oneshot: ::core::pipes::mk_packet::<Oneshot<T>>()
Oneshot: ::std::pipes::mk_packet::<Oneshot<T>>()
},
};
do ::core::pipes::entangle_buffer(buffer) |buffer, data| {
do ::std::pipes::entangle_buffer(buffer) |buffer, data| {
data.Oneshot.set_buffer(buffer);
to_mut_unsafe_ptr(&mut data.Oneshot)
}
@@ -403,23 +403,23 @@ mod pipesy {
pub enum Oneshot<T> { pub send(T), }
#[allow(non_camel_case_types)]
pub struct __Buffer<T> {
Oneshot: ::core::pipes::Packet<Oneshot<T>>,
Oneshot: ::std::pipes::Packet<Oneshot<T>>,
}
#[allow(non_camel_case_types)]
pub mod client {
priv use core::kinds::Send;
priv use std::kinds::Send;
#[allow(non_camel_case_types)]
pub fn try_send<T: Send>(pipe: Oneshot<T>, x_0: T) ->
::core::option::Option<()> {
::std::option::Option<()> {
{
use super::send;
let message = send(x_0);
if ::core::pipes::send(pipe, message) {
::core::pipes::rt::make_some(())
} else { ::core::pipes::rt::make_none() }
if ::std::pipes::send(pipe, message) {
::std::pipes::rt::make_some(())
} else { ::std::pipes::rt::make_none() }
}
}
@@ -428,13 +428,13 @@ mod pipesy {
{
use super::send;
let message = send(x_0);
::core::pipes::send(pipe, message);
::std::pipes::send(pipe, message);
}
}
#[allow(non_camel_case_types)]
pub type Oneshot<T> =
::core::pipes::SendPacketBuffered<super::Oneshot<T>,
::std::pipes::SendPacketBuffered<super::Oneshot<T>,
super::__Buffer<T>>;
}
@@ -442,7 +442,7 @@ mod pipesy {
pub mod server {
#[allow(non_camel_case_types)]
pub type Oneshot<T> =
::core::pipes::RecvPacketBuffered<super::Oneshot<T>,
::std::pipes::RecvPacketBuffered<super::Oneshot<T>,
super::__Buffer<T>>;
}
}
@@ -557,11 +557,11 @@ mod pipesy {
#[allow(non_camel_case_types)]
pub mod streamp {
priv use core::kinds::Send;
priv use std::kinds::Send;
pub fn init<T: Send>() -> (server::Open<T>, client::Open<T>) {
pub use core::pipes::HasBuffer;
::core::pipes::entangle()
pub use std::pipes::HasBuffer;
::std::pipes::entangle()
}
#[allow(non_camel_case_types)]
@@ -569,18 +569,18 @@ mod pipesy {
#[allow(non_camel_case_types)]
pub mod client {
priv use core::kinds::Send;
priv use std::kinds::Send;
#[allow(non_camel_case_types)]
pub fn try_data<T: Send>(pipe: Open<T>, x_0: T) ->
::core::option::Option<Open<T>> {
::std::option::Option<Open<T>> {
{
use super::data;
let (s, c) = ::core::pipes::entangle();
let (s, c) = ::std::pipes::entangle();
let message = data(x_0, s);
if ::core::pipes::send(pipe, message) {
::core::pipes::rt::make_some(c)
} else { ::core::pipes::rt::make_none() }
if ::std::pipes::send(pipe, message) {
::std::pipes::rt::make_some(c)
} else { ::std::pipes::rt::make_none() }
}
}
@@ -588,21 +588,21 @@ mod pipesy {
pub fn data<T: Send>(pipe: Open<T>, x_0: T) -> Open<T> {
{
use super::data;
let (s, c) = ::core::pipes::entangle();
let (s, c) = ::std::pipes::entangle();
let message = data(x_0, s);
::core::pipes::send(pipe, message);
::std::pipes::send(pipe, message);
c
}
}
#[allow(non_camel_case_types)]
pub type Open<T> = ::core::pipes::SendPacket<super::Open<T>>;
pub type Open<T> = ::std::pipes::SendPacket<super::Open<T>>;
}
#[allow(non_camel_case_types)]
pub mod server {
#[allow(non_camel_case_types)]
pub type Open<T> = ::core::pipes::RecvPacket<super::Open<T>>;
pub type Open<T> = ::std::pipes::RecvPacket<super::Open<T>>;
}
}

View File

@@ -12,7 +12,7 @@
use clone::Clone;
use container::Container;
use core::cmp::{Ord, Eq};
use std::cmp::{Ord, Eq};
use ops::{Add, Sub, Mul, Div, Rem, Neg};
use option::{None, Option, Some};
use char;

View File

@@ -209,6 +209,6 @@ fn align_down(sp: *mut uint) -> *mut uint {
// XXX: ptr::offset is positive ints only
#[inline]
pub fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T {
use core::sys::size_of;
use std::sys::size_of;
(ptr as int + count * (size_of::<T>() as int)) as *mut T
}

View File

@@ -206,16 +206,6 @@ pub mod rt;
// 'std' so that macro-expanded references to std::error and such
// can be resolved within libstd.
#[doc(hidden)]
mod core {
pub use clone;
pub use cmp;
pub use condition;
pub use option;
pub use kinds;
pub use sys;
pub use pipes;
}
#[doc(hidden)]
mod std {
pub use clone;
pub use cmp;

View File

@@ -411,7 +411,7 @@ pub fn check_integrity<T>(trie: &TrieNode<T>) {
#[cfg(test)]
mod test_map {
use super::*;
use core::option::{Some, None};
use option::{Some, None};
use uint;
#[test]