1 error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `usize`
2 --> $DIR/lint-strict-provenance-lossy-casts.rs:6:23
4 LL | let addr: usize = &x as *const u8 as usize;
5 | ^^^^^^^^^^^^^^^^^^^^^^^^
7 = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
8 note: the lint level is defined here
9 --> $DIR/lint-strict-provenance-lossy-casts.rs:2:9
11 LL | #![deny(lossy_provenance_casts)]
12 | ^^^^^^^^^^^^^^^^^^^^^^
13 help: use `.addr()` to obtain the address of a pointer
15 LL | let addr: usize = (&x as *const u8).addr();
18 error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `u32`
19 --> $DIR/lint-strict-provenance-lossy-casts.rs:9:22
21 LL | let addr_32bit = &x as *const u8 as u32;
22 | ^^^^^^^^^^^^^^^^^^^^^^
24 = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
25 help: use `.addr()` to obtain the address of a pointer
27 LL | let addr_32bit = (&x as *const u8).addr() as u32;
30 error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `usize`
31 --> $DIR/lint-strict-provenance-lossy-casts.rs:14:20
33 LL | let ptr_addr = ptr as usize;
36 | help: use `.addr()` to obtain the address of a pointer: `.addr()`
38 = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
40 error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `u32`
41 --> $DIR/lint-strict-provenance-lossy-casts.rs:16:26
43 LL | let ptr_addr_32bit = ptr as u32;
46 | help: use `.addr()` to obtain the address of a pointer: `.addr() as u32`
48 = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
50 error: aborting due to 4 previous errors