Skip to content

std: Remove old magic core mod #7919

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

Closed
wants to merge 1 commit into from
Closed
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/libstd/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
56 changes: 28 additions & 28 deletions src/libstd/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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() }
}
}

Expand All @@ -428,21 +428,21 @@ 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>>;
}

#[allow(non_camel_case_types)]
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>>;
}
}
Expand Down Expand Up @@ -557,52 +557,52 @@ 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)]
pub enum Open<T> { pub data(T, server::Open<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_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() }
}
}

#[allow(non_camel_case_types)]
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>>;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/num/strconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
10 changes: 0 additions & 10 deletions src/libstd/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down