2024-02-08 13:24:42 -06:00
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:7:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&1u8 as *const _);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&1u8)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::ref-as-ptr` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::ref_as_ptr)]`
|
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:8:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&2u32 as *const u32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<u32>(&2u32)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:9:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&3.0f64 as *const f64);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<f64>(&3.0f64)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:11:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&4 as *const _ as *const f32);
|
|
|
|
| ^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&4)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:12:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&5.0f32 as *const f32 as *const u32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<f32>(&5.0f32)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:14:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 6u8 as *const _);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&mut 6u8)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:15:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 7u32 as *const u32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<u32>(&mut 7u32)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:16:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 8.0f64 as *const f64);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<f64>(&mut 8.0f64)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:18:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 9 as *const _ as *const f32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&mut 9)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:19:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 10.0f32 as *const f32 as *const u32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<f32>(&mut 10.0f32)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:21:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 11u8 as *mut _);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut(&mut 11u8)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:22:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 12u32 as *mut u32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::<u32>(&mut 12u32)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:23:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 13.0f64 as *mut f64);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::<f64>(&mut 13.0f64)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:25:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 14 as *mut _ as *const f32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut(&mut 14)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:26:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut 15.0f32 as *mut f32 as *const u32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::<f32>(&mut 15.0f32)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:28:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&1u8 as *const _);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&1u8)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:29:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&2u32 as *const u32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<u32>(&2u32)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:30:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&3.0f64 as *const f64);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<f64>(&3.0f64)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:32:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&4 as *const _ as *const f32);
|
|
|
|
| ^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&4)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:33:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&5.0f32 as *const f32 as *const u32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<f32>(&5.0f32)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:36:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&val as *const _);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:37:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&val as *const i32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<i32>(&val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:39:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&val as *const _ as *const f32);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:40:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&val as *const i32 as *const f64);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<i32>(&val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:43:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut val as *mut u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::<u8>(&mut val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:44:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut val as *mut _);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut(&mut val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:46:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut val as *const u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<u8>(&mut val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:47:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut val as *const _);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&mut val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:49:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut val as *const u8 as *const f64);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<u8>(&mut val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:50:28
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f::<*const Option<u8>>(&mut val as *const _ as *const _);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&mut val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:52:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&std::array::from_fn(|i| i * i) as *const [usize; 7]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<[usize; 7]>(&std::array::from_fn(|i| i * i))`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:53:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut std::array::from_fn(|i| i * i) as *const [usize; 8]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<[usize; 8]>(&mut std::array::from_fn(|i| i * i))`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:54:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(&mut std::array::from_fn(|i| i * i) as *mut [usize; 9]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::<[usize; 9]>(&mut std::array::from_fn(|i| i * i))`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:76:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(val as *const i32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<i32>(val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:77:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(mut_val as *mut i32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::<i32>(mut_val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:81:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(val as *const _);
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:82:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(val as *const [u8]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<[u8]>(val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:86:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(val as *mut _);
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `std::ptr::from_mut(val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:87:7
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
LL | f(val as *mut str);
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::<str>(val)`
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:94:9
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
|
LL | self.0 as *const _ as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)`
|
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:98:9
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
|
LL | self.0 as *const _ as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)`
|
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:106:9
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
|
LL | self.0 as *const _ as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)`
|
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:110:9
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
|
LL | self.0 as *const _ as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)`
|
|
|
|
|
|
|
|
error: reference as raw pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/ref_as_ptr.rs:114:9
|
2024-02-08 13:24:42 -06:00
|
|
|
|
|
|
|
|
LL | self.0 as *mut _ as *mut _
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut(self.0)`
|
|
|
|
|
|
|
|
error: aborting due to 44 previous errors
|
|
|
|
|