Skip to content
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

rename the Ptr trait to RawPtr #6913

Merged
merged 1 commit into from
Jun 3, 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/libstd/pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ 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>;
fn offset(&self, count: uint) -> Self;
}

/// 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) }
Expand Down Expand Up @@ -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) }
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/uv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down