]> git.lizzy.rs Git - rust.git/commit
Remove `T: Sized` on `ptr::is_null()`, `as_ref()`, `as_mut()`
authorJosh Stone <jistone@redhat.com>
Fri, 29 Sep 2017 19:36:32 +0000 (12:36 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 29 Sep 2017 19:36:32 +0000 (12:36 -0700)
commit3580c4c58940ad5d62a068609b9b696e8eb31309
tree5ac0fef4f8ff1a7ec9c89744f2f1e5736216ed43
parent688a8583912a305f14ebc8bc21a2dd3cd3c912b0
Remove `T: Sized` on `ptr::is_null()`, `as_ref()`, `as_mut()`

`NonZero::is_zero()` was already casting all pointers to thin `*mut u8`
to check for null.  It seems reasonable to apply that for `is_null()` in
general, and then unsized fat pointers can also be used with `as_ref()`
and `as_mut()` to get fat references.
src/libcore/nonzero.rs
src/libcore/ptr.rs
src/libcore/tests/ptr.rs