Resolve ptr_cast_constness pedantic clippy lint
Before adoption: this commit came in with the history the project adopted, so no landing records it.
warning: `as` casting between raw pointers while changing only its constness --> src/error.rs:782:32 | 782 | NonNull::new_unchecked(ptr::addr_of!((*unerased_ref.as_ptr())._object) as *mut E) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr::addr_of!((*unerased_ref.as_ptr())._object).cast_mut()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness = note: `-W clippy::ptr-cast-constness` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::ptr_cast_constness)]` warning: `as` casting between raw pointers while changing only its constness --> src/error.rs:819:40 | 819 | NonNull::new_unchecked(ptr::addr_of!((*unerased_ref.as_ptr())._object) as *mut E) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr::addr_of!((*unerased_ref.as_ptr())._object).cast_mut()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness warning: `as` casting between raw pointers while changing only its constness --> src/ptr.rs:116:9 | 116 | self.ptr.as_ptr() as *const T | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `self.ptr.as_ptr().cast_const()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness warning: `as` casting between raw pointers while changing only its constness --> tests/test_ensure.rs:540:30 | 540 | let test = || Ok(ensure!(0 as *const () as *mut _ == 1 as *mut ())); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `(0 as *const ()).cast_mut()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness = note: `-W clippy::ptr-cast-constness` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::ptr_cast_constness)]`
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+4 added−3 removed
- tests:+1 added−0 removed
- other:+3 added−3 removed