auto merge of #6913 : thestinger/rust/ptr, r=graydon

Closes #6607

I went with `RawPtr` instead of `UnsafePtr` because not all of these operations are `unsafe`, so to me it makes more sense to refer to it as a "raw" (not wrapped/abstracted) pointer. If we decide on something else in #6608 it can be renamed again.
This commit is contained in:
bors 2013-06-03 11:38:09 -07:00
commit 5ddbc881c5
8 changed files with 10 additions and 10 deletions

View File

@ -94,7 +94,7 @@ use option::{None, Option, Some};
use unstable::finally::Finally;
use unstable::intrinsics;
use ptr;
use ptr::Ptr;
use ptr::RawPtr;
use task;
use vec;
use vec::OwnedVector;

View File

@ -43,7 +43,7 @@ pub use path::GenericPath;
pub use path::Path;
pub use path::PosixPath;
pub use path::WindowsPath;
pub use ptr::Ptr;
pub use ptr::RawPtr;
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr};
pub use str::{StrVector, StrSlice, OwnedStr, StrUtil};
pub use from_str::{FromStr};

View File

@ -296,7 +296,7 @@ pub unsafe fn array_each<T>(arr: **T, cb: &fn(*T)) {
}
#[allow(missing_doc)]
pub trait Ptr<T> {
pub trait RawPtr<T> {
fn is_null(&const self) -> bool;
fn is_not_null(&const self) -> bool;
unsafe fn to_option(&const self) -> Option<&T>;
@ -304,7 +304,7 @@ pub trait Ptr<T> {
}
/// Extension methods for immutable pointers
impl<T> Ptr<T> for *T {
impl<T> RawPtr<T> for *T {
/// Returns true if the pointer is equal to the null pointer.
#[inline(always)]
fn is_null(&const self) -> bool { is_null(*self) }
@ -336,7 +336,7 @@ impl<T> Ptr<T> for *T {
}
/// Extension methods for mutable pointers
impl<T> Ptr<T> for *mut T {
impl<T> RawPtr<T> for *mut T {
/// Returns true if the pointer is equal to the null pointer.
#[inline(always)]
fn is_null(&const self) -> bool { is_null(*self) }

View File

@ -56,7 +56,7 @@ Several modules in `core` are clients of `rt`:
#[doc(hidden)];
use ptr::Ptr;
use ptr::RawPtr;
/// The global (exchange) heap.
pub mod global_heap;

View File

@ -9,7 +9,7 @@
// except according to those terms.
use container::Container;
use ptr::Ptr;
use ptr::RawPtr;
use vec;
use ops::Drop;
use libc::{c_uint, uintptr_t};

View File

@ -38,7 +38,7 @@ use container::Container;
use option::*;
use str::raw::from_c_str;
use to_str::ToStr;
use ptr::Ptr;
use ptr::RawPtr;
use libc;
use vec;
use ptr;

View File

@ -30,7 +30,7 @@ use libc;
use option::{None, Option, Some};
use old_iter::{BaseIter, EqIter};
use ptr;
use ptr::Ptr;
use ptr::RawPtr;
use str;
use to_str::ToStr;
use uint;

View File

@ -26,7 +26,7 @@ use old_iter::CopyableIter;
use option::{None, Option, Some};
use ptr::to_unsafe_ptr;
use ptr;
use ptr::Ptr;
use ptr::RawPtr;
use sys;
use uint;
use unstable::intrinsics;