Skip to content

Commit d2727ef

Browse files
committed
Ignore ref_as_ptr pedantic clippy lint
warning: reference as raw pointer --> gen/build/src/cargo.rs:99:21 | 99 | unsafe { &*(name as *const str as *const Self) } | ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<str>(name)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr = note: `-W clippy::ref-as-ptr` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::ref_as_ptr)]` warning: reference as raw pointer --> src/cxx_vector.rs:96:20 | 96 | let this = self as *const CxxVector<T> as *mut CxxVector<T>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<CxxVector<T>>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr = note: `-W clippy::ref-as-ptr` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::ref_as_ptr)]` warning: reference as raw pointer --> src/cxx_vector.rs:136:24 | 136 | let this = self as *const CxxVector<T> as *mut CxxVector<T>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<CxxVector<T>>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_string.rs:20:21 | 20 | unsafe { &*(s as *const String as *const RustString) } | ^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<String>(s)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_string.rs:24:25 | 24 | unsafe { &mut *(s as *mut String as *mut RustString) } | ^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_mut::<String>(s)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_string.rs:32:21 | 32 | unsafe { &*(self as *const RustString as *const String) } | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<RustString>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_string.rs:36:25 | 36 | unsafe { &mut *(self as *mut RustString as *mut String) } | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_mut::<RustString>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_vec.rs:29:21 | 29 | unsafe { &*(v as *const Vec<T> as *const RustVec<T>) } | ^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<Vec<T>>(v)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_vec.rs:33:25 | 33 | unsafe { &mut *(v as *mut Vec<T> as *mut RustVec<T>) } | ^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_mut::<Vec<T>>(v)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_vec.rs:41:21 | 41 | unsafe { &*(self as *const RustVec<T> as *const Vec<T>) } | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<RustVec<T>>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_vec.rs:45:25 | 45 | unsafe { &mut *(self as *mut RustVec<T> as *mut Vec<T>) } | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_mut::<RustVec<T>>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_vec.rs:87:36 | 87 | Self::from_ref(unsafe { &*(v as *const Vec<String> as *const Vec<RustString>) }) | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<Vec<String>>(v)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_vec.rs:91:40 | 91 | Self::from_mut(unsafe { &mut *(v as *mut Vec<String> as *mut Vec<RustString>) }) | ^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_mut::<Vec<String>>(v)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_vec.rs:103:21 | 103 | unsafe { &*(self as *const RustVec<RustString> as *const Vec<String>) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<RustVec<RustString>>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/rust_vec.rs:107:25 | 107 | unsafe { &mut *(self as *mut RustVec<RustString> as *mut Vec<String>) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_mut::<RustVec<RustString>>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/shared_ptr.rs:57:20 | 57 | let this = self as *const Self as *const c_void; | ^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<Self>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/shared_ptr.rs:65:20 | 65 | let this = self as *const Self as *const c_void; | ^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<Self>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/shared_ptr.rs:78:20 | 78 | let this = self as *const Self as *const c_void; | ^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<Self>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/shared_ptr.rs:98:20 | 98 | let this = self as *const Self as *mut c_void; | ^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<Self>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/shared_ptr.rs:115:20 | 115 | let this = self as *mut Self as *mut c_void; | ^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_mut::<Self>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/weak_ptr.rs:47:20 | 47 | let this = self as *const Self as *const c_void; | ^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<Self>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/weak_ptr.rs:67:20 | 67 | let this = self as *const Self as *mut c_void; | ^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<Self>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr warning: reference as raw pointer --> src/weak_ptr.rs:80:20 | 80 | let this = self as *mut Self as *mut c_void; | ^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_mut::<Self>(self)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr
1 parent dac5629 commit d2727ef

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

gen/build/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
clippy::needless_pass_by_value,
6565
clippy::nonminimal_bool,
6666
clippy::redundant_else,
67+
clippy::ref_as_ptr,
6768
clippy::ref_option,
6869
clippy::similar_names,
6970
clippy::single_match_else,

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@
392392
clippy::new_without_default,
393393
clippy::ptr_as_ptr,
394394
clippy::ptr_cast_constness,
395+
clippy::ref_as_ptr,
395396
clippy::uninlined_format_args
396397
)]
397398

0 commit comments

Comments
 (0)