summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/ptr_as_ptr.stderr
blob: c0ce69b4357de9b43fb3847a2491effb85d5153f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:18:33
   |
LL |         *unsafe { Box::from_raw(Box::into_raw(Box::new(o)) as *mut super::issue_11278_a::T<String>) }
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `Box::into_raw(Box::new(o)).cast::<super::issue_11278_a::T<String>>()`
   |
   = note: `-D clippy::ptr-as-ptr` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::ptr_as_ptr)]`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:27:13
   |
LL |     let _ = ptr as *const i32;
   |             ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:28:13
   |
LL |     let _ = mut_ptr as *mut i32;
   |             ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:33:17
   |
LL |         let _ = *ptr_ptr as *const i32;
   |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `(*ptr_ptr).cast::<i32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:46:25
   |
LL |     let _: *const i32 = ptr as *const _;
   |                         ^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:47:23
   |
LL |     let _: *mut i32 = mut_ptr as _;
   |                       ^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:50:21
   |
LL |     let _ = inline!($ptr as *const i32);
   |                     ^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `$ptr.cast::<i32>()`
   |
   = note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:71:13
   |
LL |     let _ = ptr as *const i32;
   |             ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:72:13
   |
LL |     let _ = mut_ptr as *mut i32;
   |             ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`

error: aborting due to 9 previous errors