fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.8 KiB61 linesraw
1error: `as` casting between raw pointers without changing its mutability
2  --> $DIR/ptr_as_ptr.rs:18:33
3   |
4LL |         *unsafe { Box::from_raw(Box::into_raw(Box::new(o)) as *mut super::issue_11278_a::T<String>) }
5   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `Box::into_raw(Box::new(o)).cast::<super::issue_11278_a::T<String>>()`
6   |
7   = note: `-D clippy::ptr-as-ptr` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::ptr_as_ptr)]`
9
10error: `as` casting between raw pointers without changing its mutability
11  --> $DIR/ptr_as_ptr.rs:27:13
12   |
13LL |     let _ = ptr as *const i32;
14   |             ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()`
15
16error: `as` casting between raw pointers without changing its mutability
17  --> $DIR/ptr_as_ptr.rs:28:13
18   |
19LL |     let _ = mut_ptr as *mut i32;
20   |             ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`
21
22error: `as` casting between raw pointers without changing its mutability
23  --> $DIR/ptr_as_ptr.rs:33:17
24   |
25LL |         let _ = *ptr_ptr as *const i32;
26   |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `(*ptr_ptr).cast::<i32>()`
27
28error: `as` casting between raw pointers without changing its mutability
29  --> $DIR/ptr_as_ptr.rs:46:25
30   |
31LL |     let _: *const i32 = ptr as *const _;
32   |                         ^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast()`
33
34error: `as` casting between raw pointers without changing its mutability
35  --> $DIR/ptr_as_ptr.rs:47:23
36   |
37LL |     let _: *mut i32 = mut_ptr as _;
38   |                       ^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast()`
39
40error: `as` casting between raw pointers without changing its mutability
41  --> $DIR/ptr_as_ptr.rs:50:21
42   |
43LL |     let _ = inline!($ptr as *const i32);
44   |                     ^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `$ptr.cast::<i32>()`
45   |
46   = note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)
47
48error: `as` casting between raw pointers without changing its mutability
49  --> $DIR/ptr_as_ptr.rs:71:13
50   |
51LL |     let _ = ptr as *const i32;
52   |             ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()`
53
54error: `as` casting between raw pointers without changing its mutability
55  --> $DIR/ptr_as_ptr.rs:72:13
56   |
57LL |     let _ = mut_ptr as *mut i32;
58   |             ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`
59
60error: aborting due to 9 previous errors
61