diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-07-11 12:45:54 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-07-11 12:47:32 -0700 |
| commit | fdf0c1b353393ff34b1dee6edfbfece13f7c3093 (patch) | |
| tree | 8b2801f2f3ce11e49e56a0e7d131fc725d2ed3eb /src/libcore/ptr.rs | |
| parent | c0961bb88fe274795725c871871d7053429ae22e (diff) | |
| download | rust-fdf0c1b353393ff34b1dee6edfbfece13f7c3093.tar.gz rust-fdf0c1b353393ff34b1dee6edfbfece13f7c3093.zip | |
core: Newtype a bunch of types in libcore
Diffstat (limited to 'src/libcore/ptr.rs')
| -rw-r--r-- | src/libcore/ptr.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 704c0fcaf4b..97795103f52 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -123,8 +123,13 @@ unsafe fn memset<T>(dst: *mut T, c: int, count: uint) { libc_::memset(dst as *c_void, c as libc::c_int, n as size_t); } +trait ptr { + pure fn is_null() -> bool; + pure fn is_not_null() -> bool; +} + /// Extension methods for pointers -impl extensions<T> for *T { +impl extensions<T> of ptr for *T { /// Returns true if the pointer is equal to the null pointer. pure fn is_null() -> bool { is_null(self) } |
