Skip to content

Commit f4cc5ff

Browse files
committed
remove extra type parameter from ptr::is_null() and friends
1 parent 358dc59 commit f4cc5ff

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/libcore/ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ unsafe fn memmove<T>(dst: *T, src: *T, count: uint) {
104104
#[doc = "Extension methods for pointers"]
105105
impl extensions<T> for *T {
106106
#[doc = "Returns true if the pointer is equal to the null pointer."]
107-
pure fn is_null<T>() -> bool { is_null(self) }
107+
pure fn is_null() -> bool { is_null(self) }
108108

109109
#[doc = "Returns true if the pointer is not equal to the null pointer."]
110-
pure fn is_not_null<T>() -> bool { is_not_null(self) }
110+
pure fn is_not_null() -> bool { is_not_null(self) }
111111
}
112112

113113
#[test]

src/test/run-pass/ptr-is-null.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn main() {
2+
let p: *int = ptr::null();
3+
assert p.is_null();
4+
assert !p.is_not_null();
5+
6+
let q = ptr::offset(p, 1u);
7+
assert !q.is_null();
8+
assert q.is_not_null();
9+
}

0 commit comments

Comments
 (0)