summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/ptr_as_ptr.stderr
blob: ef64347e9350c0a08d273071fd3aa0a499fa7f19 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:79:9
   |
LL |         ptr::null_mut() as *mut u32
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut::<u32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:83:9
   |
LL |         std::ptr::null_mut() as *mut u32
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null_mut::<u32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:88:9
   |
LL |         ptr::null_mut() as *mut u32
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut::<u32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:92:9
   |
LL |         core::ptr::null_mut() as *mut u32
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null_mut::<u32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:97:9
   |
LL |         ptr::null() as *const u32
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null::<u32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:101:9
   |
LL |         std::ptr::null() as *const u32
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null::<u32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:106:9
   |
LL |         ptr::null() as *const u32
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null::<u32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:110:9
   |
LL |         core::ptr::null() as *const u32
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null::<u32>()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:117:9
   |
LL |         ptr::null_mut() as *mut _
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:121:9
   |
LL |         std::ptr::null_mut() as *mut _
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null_mut()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:126:9
   |
LL |         ptr::null_mut() as *mut _
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:130:9
   |
LL |         core::ptr::null_mut() as *mut _
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null_mut()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:135:9
   |
LL |         ptr::null() as *const _
   |         ^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:139:9
   |
LL |         std::ptr::null() as *const _
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:144:9
   |
LL |         ptr::null() as *const _
   |         ^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:148:9
   |
LL |         core::ptr::null() as *const _
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:155:9
   |
LL |         ptr::null_mut() as _
   |         ^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:159:9
   |
LL |         std::ptr::null_mut() as _
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null_mut()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:164:9
   |
LL |         ptr::null_mut() as _
   |         ^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:168:9
   |
LL |         core::ptr::null_mut() as _
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null_mut()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:173:9
   |
LL |         ptr::null() as _
   |         ^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:177:9
   |
LL |         std::ptr::null() as _
   |         ^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:182:9
   |
LL |         ptr::null() as _
   |         ^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`

error: `as` casting between raw pointers without changing its mutability
  --> $DIR/ptr_as_ptr.rs:186:9
   |
LL |         core::ptr::null() as _
   |         ^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null()`

error: aborting due to 33 previous errors