fork/rust

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

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

master
1.1 KiB29 linesraw
1error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u16`) (1 < 2 bytes)
2  --> $DIR/cast_alignment.rs:19:5
3   |
4LL |     (&1u8 as *const u8) as *const u16;
5   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7   = note: `-D clippy::cast-ptr-alignment` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::cast_ptr_alignment)]`
9
10error: casting from `*mut u8` to a more-strictly-aligned pointer (`*mut u16`) (1 < 2 bytes)
11  --> $DIR/cast_alignment.rs:22:5
12   |
13LL |     (&mut 1u8 as *mut u8) as *mut u16;
14   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15
16error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u16`) (1 < 2 bytes)
17  --> $DIR/cast_alignment.rs:26:5
18   |
19LL |     (&1u8 as *const u8).cast::<u16>();
20   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
22error: casting from `*mut u8` to a more-strictly-aligned pointer (`*mut u16`) (1 < 2 bytes)
23  --> $DIR/cast_alignment.rs:28:5
24   |
25LL |     (&mut 1u8 as *mut u8).cast::<u16>();
26   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27
28error: aborting due to 4 previous errors
29