fork/rust

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

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

master
2.1 KiB47 linesraw
1error: `as` casting between raw pointers while changing only its constness
2  --> $DIR/ptr_cast_constness.rs:10:41
3   |
4LL |     let _: &mut T = std::mem::transmute(p as *mut T);
5   |                                         ^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `p.cast_mut()`
6   |
7   = note: `-D clippy::ptr-cast-constness` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::ptr_cast_constness)]`
9
10error: `as` casting between raw pointers while changing only its constness
11  --> $DIR/ptr_cast_constness.rs:11:19
12   |
13LL |     let _ = &mut *(p as *mut T);
14   |                   ^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `p.cast_mut()`
15
16error: `as` casting between raw pointers while changing only its constness
17  --> $DIR/ptr_cast_constness.rs:26:17
18   |
19LL |         let _ = *ptr_ptr as *mut u32;
20   |                 ^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `(*ptr_ptr).cast_mut()`
21
22error: `as` casting between raw pointers while changing only its constness
23  --> $DIR/ptr_cast_constness.rs:29:13
24   |
25LL |     let _ = ptr as *mut u32;
26   |             ^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr.cast_mut()`
27
28error: `as` casting between raw pointers while changing only its constness
29  --> $DIR/ptr_cast_constness.rs:30:13
30   |
31LL |     let _ = mut_ptr as *const u32;
32   |             ^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `mut_ptr.cast_const()`
33
34error: `as` casting between raw pointers while changing only its constness
35  --> $DIR/ptr_cast_constness.rs:59:13
36   |
37LL |     let _ = ptr as *mut u32;
38   |             ^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr.cast_mut()`
39
40error: `as` casting between raw pointers while changing only its constness
41  --> $DIR/ptr_cast_constness.rs:60:13
42   |
43LL |     let _ = mut_ptr as *const u32;
44   |             ^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `mut_ptr.cast_const()`
45
46error: aborting due to 7 previous errors
47