Skip to content

Commit 5ddbc88

Browse files
committed
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.
2 parents 4f6285f + e900dba commit 5ddbc88

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

src/libstd/pipes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ use option::{None, Option, Some};
9494
use unstable::finally::Finally;
9595
use unstable::intrinsics;
9696
use ptr;
97-
use ptr::Ptr;
97+
use ptr::RawPtr;
9898
use task;
9999
use vec;
100100
use vec::OwnedVector;

src/libstd/prelude.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub use path::GenericPath;
4343
pub use path::Path;
4444
pub use path::PosixPath;
4545
pub use path::WindowsPath;
46-
pub use ptr::Ptr;
46+
pub use ptr::RawPtr;
4747
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr};
4848
pub use str::{StrVector, StrSlice, OwnedStr, StrUtil};
4949
pub use from_str::{FromStr};

src/libstd/ptr.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,15 @@ pub unsafe fn array_each<T>(arr: **T, cb: &fn(*T)) {
296296
}
297297

298298
#[allow(missing_doc)]
299-
pub trait Ptr<T> {
299+
pub trait RawPtr<T> {
300300
fn is_null(&const self) -> bool;
301301
fn is_not_null(&const self) -> bool;
302302
unsafe fn to_option(&const self) -> Option<&T>;
303303
fn offset(&self, count: uint) -> Self;
304304
}
305305

306306
/// Extension methods for immutable pointers
307-
impl<T> Ptr<T> for *T {
307+
impl<T> RawPtr<T> for *T {
308308
/// Returns true if the pointer is equal to the null pointer.
309309
#[inline(always)]
310310
fn is_null(&const self) -> bool { is_null(*self) }
@@ -336,7 +336,7 @@ impl<T> Ptr<T> for *T {
336336
}
337337

338338
/// Extension methods for mutable pointers
339-
impl<T> Ptr<T> for *mut T {
339+
impl<T> RawPtr<T> for *mut T {
340340
/// Returns true if the pointer is equal to the null pointer.
341341
#[inline(always)]
342342
fn is_null(&const self) -> bool { is_null(*self) }

src/libstd/rt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Several modules in `core` are clients of `rt`:
5656

5757
#[doc(hidden)];
5858

59-
use ptr::Ptr;
59+
use ptr::RawPtr;
6060

6161
/// The global (exchange) heap.
6262
pub mod global_heap;

src/libstd/rt/stack.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use container::Container;
12-
use ptr::Ptr;
12+
use ptr::RawPtr;
1313
use vec;
1414
use ops::Drop;
1515
use libc::{c_uint, uintptr_t};

src/libstd/rt/uv/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use container::Container;
3838
use option::*;
3939
use str::raw::from_c_str;
4040
use to_str::ToStr;
41-
use ptr::Ptr;
41+
use ptr::RawPtr;
4242
use libc;
4343
use vec;
4444
use ptr;

src/libstd/str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use libc;
3030
use option::{None, Option, Some};
3131
use old_iter::{BaseIter, EqIter};
3232
use ptr;
33-
use ptr::Ptr;
33+
use ptr::RawPtr;
3434
use str;
3535
use to_str::ToStr;
3636
use uint;

src/libstd/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use old_iter::CopyableIter;
2626
use option::{None, Option, Some};
2727
use ptr::to_unsafe_ptr;
2828
use ptr;
29-
use ptr::Ptr;
29+
use ptr::RawPtr;
3030
use sys;
3131
use uint;
3232
use unstable::intrinsics;

0 commit comments

Comments
 (0)