Fix missing space in lossy provenance cast lint

This commit is contained in:
niluxv 2022-04-09 17:39:07 +02:00
parent fbdb10f9fa
commit 1834c21f88
2 changed files with 3 additions and 3 deletions

View File

@ -1012,7 +1012,7 @@ fn lossy_provenance_ptr2int_lint(&self, fcx: &FnCtxt<'a, 'tcx>, t_c: ty::cast::I
err.help(msg);
}
err.help(
"if you can't comply with strict provenance and need to expose the pointer\
"if you can't comply with strict provenance and need to expose the pointer \
provenance you can use `.expose_addr()` instead"
);

View File

@ -9,7 +9,7 @@ note: the lint level is defined here
|
LL | #![deny(lossy_provenance_casts)]
| ^^^^^^^^^^^^^^^^^^^^^^
= help: if you can't comply with strict provenance and need to expose the pointerprovenance you can use `.expose_addr()` instead
= help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `u32`
--> $DIR/lint-strict-provenance-lossy-casts.rs:9:22
@ -17,7 +17,7 @@ error: under strict provenance it is considered bad style to cast pointer `*cons
LL | let addr_32bit = &x as *const u8 as u32;
| ^^^^^^^^^^^^^^^^^^^^^^ help: use `.addr()` to obtain the address of a pointer: `(&x as *const u8).addr() as u32`
|
= help: if you can't comply with strict provenance and need to expose the pointerprovenance you can use `.expose_addr()` instead
= help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
error: aborting due to 2 previous errors