std: Move intrinsics to std::intrinsics.

Issue #1457
This commit is contained in:
Brian Anderson 2014-02-15 23:49:08 -08:00
parent edf351e9f7
commit 4d10bdc5b9
41 changed files with 49 additions and 47 deletions

View File

@ -37,8 +37,8 @@ use std::num;
use std::kinds::marker;
use std::rc::Rc;
use std::rt::global_heap;
use std::unstable::intrinsics::{TyDesc, get_tydesc};
use std::unstable::intrinsics;
use std::intrinsics::{TyDesc, get_tydesc};
use std::intrinsics;
use std::vec;
// The way arena uses arrays is really deeply awful. The arrays are

View File

@ -124,7 +124,7 @@ memory and partly incapable of presentation to others.",
abort();
fn abort() -> ! {
use std::unstable::intrinsics;
use std::intrinsics;
unsafe { intrinsics::abort() }
}
}

View File

@ -15,7 +15,7 @@ use std::libc;
use std::mem;
use std::rt::rtio;
use std::sync::arc::UnsafeArc;
use std::unstable::intrinsics;
use std::intrinsics;
use super::{IoResult, retry};
use super::file::{keep_going, fd_t};

View File

@ -90,7 +90,7 @@ use std::os::win32::as_utf16_p;
use std::ptr;
use std::rt::rtio;
use std::sync::arc::UnsafeArc;
use std::unstable::intrinsics;
use std::intrinsics;
use super::IoResult;

View File

@ -32,7 +32,7 @@ use std::io;
use std::libc;
use std::mem;
use std::str;
use std::unstable::intrinsics;
use std::intrinsics;
use std::vec;
/// A unit struct which has the `fmt::Show` trait implemented. When

View File

@ -25,8 +25,8 @@ use fmt;
use option::{Option, Some, None};
use result::{Result, Ok, Err};
use to_str::ToStr;
use unstable::intrinsics::TypeId;
use unstable::intrinsics;
use intrinsics::TypeId;
use intrinsics;
/// A type with no inhabitants
pub enum Void { }

View File

@ -11,7 +11,7 @@
//! Unsafe casting functions
use mem;
use unstable::intrinsics;
use intrinsics;
use ptr::copy_nonoverlapping_memory;
/// Casts the value at `src` to U. The two types must have the same length.

View File

@ -41,9 +41,11 @@ A quick refresher on memory ordering:
*/
#[allow(missing_doc)];
// This is needed to prevent duplicate lang item definitions.
#[cfg(test)]
pub use realstd::unstable::intrinsics::{TyDesc, Opaque, TyVisitor, TypeId};
pub use realstd::intrinsics::{TyDesc, Opaque, TyVisitor, TypeId};
pub type GlueFn = extern "Rust" fn(*i8);

View File

@ -196,7 +196,8 @@ pub mod reflect;
// Private APIs
#[unstable]
pub mod unstable;
#[experimental]
pub mod intrinsics;
/* For internal use, not exported */

View File

@ -281,7 +281,7 @@ fn get_with<T:'static,
}
fn abort() -> ! {
use std::unstable::intrinsics;
use intrinsics;
unsafe { intrinsics::abort() }
}

View File

@ -17,8 +17,8 @@
use cast;
use ptr;
use unstable::intrinsics;
use unstable::intrinsics::{bswap16, bswap32, bswap64};
use intrinsics;
use intrinsics::{bswap16, bswap32, bswap64};
/// Returns the size of a type in bytes.
#[inline]

View File

@ -20,7 +20,7 @@ use num::{FPCategory, FPNaN, FPInfinite , FPZero, FPSubnormal, FPNormal};
use num::{Zero, One, Bounded, strconv};
use num;
use to_str;
use unstable::intrinsics;
use intrinsics;
macro_rules! delegate(
(

View File

@ -21,7 +21,7 @@ use num::{FPCategory, FPNaN, FPInfinite , FPZero, FPSubnormal, FPNormal};
use num::{Zero, One, Bounded, strconv};
use num;
use to_str;
use unstable::intrinsics;
use intrinsics;
pub use cmp::{min, max};

View File

@ -20,7 +20,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
int_module!(i16, 16)

View File

@ -20,7 +20,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
int_module!(i32, 32)

View File

@ -22,7 +22,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
int_module!(i64, 64)

View File

@ -20,7 +20,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
int_module!(i8, 8)

View File

@ -20,7 +20,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
#[cfg(target_word_size = "32")] int_module!(int, 32)
#[cfg(target_word_size = "64")] int_module!(int, 64)

View File

@ -21,7 +21,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
uint_module!(u16, i16, 16)

View File

@ -21,7 +21,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
uint_module!(u32, i32, 32)

View File

@ -23,7 +23,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
uint_module!(u64, i64, 64)

View File

@ -21,7 +21,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
uint_module!(u8, i8, 8)

View File

@ -21,7 +21,7 @@ use num::{CheckedDiv, Zero, One, strconv};
use num::{ToStrRadix, FromStrRadix};
use option::{Option, Some, None};
use str;
use unstable::intrinsics;
use intrinsics;
uint_module!(uint, int, ::int::BITS)

View File

@ -17,7 +17,7 @@ use cmp::Equiv;
use iter::{range, Iterator};
use mem;
use option::{Option, Some, None};
use unstable::intrinsics;
use intrinsics;
#[cfg(not(test))] use cmp::{Eq, Ord};

View File

@ -16,7 +16,7 @@ Runtime type reflection
#[allow(missing_doc)];
use unstable::intrinsics::{Disr, Opaque, TyDesc, TyVisitor};
use intrinsics::{Disr, Opaque, TyDesc, TyVisitor};
use mem;
use unstable::raw;

View File

@ -29,7 +29,7 @@ use result::{Ok, Err};
use str::StrSlice;
use to_str::ToStr;
use vec::OwnedVector;
use unstable::intrinsics::{Disr, Opaque, TyDesc, TyVisitor, get_tydesc, visit_tydesc};
use intrinsics::{Disr, Opaque, TyDesc, TyVisitor, get_tydesc, visit_tydesc};
use unstable::raw;
macro_rules! try( ($me:expr, $e:expr) => (

View File

@ -10,7 +10,7 @@
use libc::{c_void, size_t, free, malloc, realloc};
use ptr::{RawPtr, mut_null};
use unstable::intrinsics::abort;
use intrinsics::abort;
use unstable::raw;
use mem::size_of;

View File

@ -69,7 +69,7 @@ use rt::local::Local;
use rt::task::Task;
use str::Str;
use task::TaskResult;
use unstable::intrinsics;
use intrinsics;
use uw = self::libunwind;

View File

@ -143,7 +143,7 @@ memory and partly incapable of presentation to others.",
abort();
fn abort() -> ! {
use std::unstable::intrinsics;
use intrinsics;
unsafe { intrinsics::abort() }
}
}

View File

@ -21,7 +21,7 @@
#[allow(missing_doc)];
use unstable::intrinsics;
use intrinsics;
use cast;
use std::kinds::marker;
use option::{Option,Some,None};

View File

@ -16,7 +16,6 @@ use libc::uintptr_t;
pub mod dynamic_lib;
pub mod finally;
pub mod intrinsics;
pub mod simd;
#[cfg(not(test))]
pub mod lang;

View File

@ -40,7 +40,7 @@ pub extern "C" fn rust_stack_exhausted() {
use rt::local::Local;
use rt::task::Task;
use str::Str;
use unstable::intrinsics;
use intrinsics;
unsafe {
// We're calling this function because the stack just ran out. We need

View File

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::unstable::intrinsics;
use std::unstable::intrinsics::TypeId;
use std::intrinsics;
use std::intrinsics::TypeId;
pub struct A;
pub struct B(Option<A>);

View File

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::unstable::intrinsics;
use std::unstable::intrinsics::TypeId;
use std::intrinsics;
use std::intrinsics::TypeId;
pub struct A;
pub struct B(Option<A>);

View File

@ -18,7 +18,7 @@ use std::io;
use std::io::stdio::StdReader;
use std::io::BufferedReader;
use std::os;
use std::unstable::intrinsics::cttz16;
use std::intrinsics::cttz16;
use std::vec;
// Computes a single solution to a given 9x9 sudoku

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::unstable::intrinsics::{init, forget};
use std::intrinsics::{init, forget};
// Test that the `forget` and `init` intrinsics are really unsafe
pub fn main() {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::unstable::intrinsics::{volatile_load, volatile_store};
use std::intrinsics::{volatile_load, volatile_store};
pub fn main() {
unsafe {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::unstable::intrinsics;
use std::intrinsics;
/// Returns the size of a type
pub fn size_of<T>() -> uint {

View File

@ -10,7 +10,7 @@
#[feature(managed_boxes)];
use std::unstable::intrinsics::{TyDesc, get_tydesc, visit_tydesc, TyVisitor, Disr, Opaque};
use std::intrinsics::{TyDesc, get_tydesc, visit_tydesc, TyVisitor, Disr, Opaque};
struct MyVisitor {
types: ~[~str],

View File

@ -10,7 +10,7 @@
// ignore-fast: check-fast screws up repr paths
use std::unstable::intrinsics::get_tydesc;
use std::intrinsics::get_tydesc;
struct Foo<T> {
x: T

View File

@ -16,8 +16,8 @@ extern crate other1 = "typeid-intrinsic";
extern crate other2 = "typeid-intrinsic2";
use std::hash_old::Hash;
use std::unstable::intrinsics;
use std::unstable::intrinsics::TypeId;
use std::intrinsics;
use std::intrinsics::TypeId;
struct A;
struct Test;