]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/ptr_as_ptr.stderr
Rollup merge of #93692 - mfrw:mfrw/document-keyword-in, r=dtolnay
[rust.git] / src / tools / clippy / tests / ui / ptr_as_ptr.stderr
1 error: `as` casting between raw pointers without changing its mutability
2   --> $DIR/ptr_as_ptr.rs:19:13
3    |
4 LL |     let _ = ptr as *const i32;
5    |             ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()`
6    |
7    = note: `-D clippy::ptr-as-ptr` implied by `-D warnings`
8
9 error: `as` casting between raw pointers without changing its mutability
10   --> $DIR/ptr_as_ptr.rs:20:13
11    |
12 LL |     let _ = mut_ptr as *mut i32;
13    |             ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`
14
15 error: `as` casting between raw pointers without changing its mutability
16   --> $DIR/ptr_as_ptr.rs:25:17
17    |
18 LL |         let _ = *ptr_ptr as *const i32;
19    |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `(*ptr_ptr).cast::<i32>()`
20
21 error: `as` casting between raw pointers without changing its mutability
22   --> $DIR/ptr_as_ptr.rs:38:25
23    |
24 LL |     let _: *const i32 = ptr as *const _;
25    |                         ^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast()`
26
27 error: `as` casting between raw pointers without changing its mutability
28   --> $DIR/ptr_as_ptr.rs:39:23
29    |
30 LL |     let _: *mut i32 = mut_ptr as _;
31    |                       ^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast()`
32
33 error: `as` casting between raw pointers without changing its mutability
34   --> $DIR/ptr_as_ptr.rs:11:9
35    |
36 LL |         $ptr as *const i32
37    |         ^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `$ptr.cast::<i32>()`
38 ...
39 LL |     let _ = cast_it!(ptr);
40    |             ------------- in this macro invocation
41    |
42    = note: this error originates in the macro `cast_it` (in Nightly builds, run with -Z macro-backtrace for more info)
43
44 error: `as` casting between raw pointers without changing its mutability
45   --> $DIR/ptr_as_ptr.rs:63:13
46    |
47 LL |     let _ = ptr as *const i32;
48    |             ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()`
49
50 error: `as` casting between raw pointers without changing its mutability
51   --> $DIR/ptr_as_ptr.rs:64:13
52    |
53 LL |     let _ = mut_ptr as *mut i32;
54    |             ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`
55
56 error: aborting due to 8 previous errors
57