diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-04-10 21:03:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-10 21:03:37 +0200 |
| commit | a52eb325e6248a77c0bf8a1dcc02a1c452d2f6c4 (patch) | |
| tree | 11d6dc89a5c3c555c0e42f50edd2d617aa9b7e80 | |
| parent | 0b871435e97c3f9e6ead6ca09af979a2c2b517ed (diff) | |
| parent | 1834c21f88cac45c3b4b8c1c50855b06668516a5 (diff) | |
| download | rust-a52eb325e6248a77c0bf8a1dcc02a1c452d2f6c4.tar.gz rust-a52eb325e6248a77c0bf8a1dcc02a1c452d2f6c4.zip | |
Rollup merge of #95852 - niluxv:strict-provenance-lint-fixup, r=Dylan-DPC
Fix missing space in lossy provenance cast lint See https://github.com/rust-lang/rust/pull/95599#discussion_r846425050
| -rw-r--r-- | compiler/rustc_typeck/src/check/cast.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_typeck/src/check/cast.rs b/compiler/rustc_typeck/src/check/cast.rs index 6091b8fee00..e73b9c979eb 100644 --- a/compiler/rustc_typeck/src/check/cast.rs +++ b/compiler/rustc_typeck/src/check/cast.rs @@ -1012,7 +1012,7 @@ impl<'a, 'tcx> CastCheck<'tcx> { 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" ); diff --git a/src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr b/src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr index 489cb03ddd3..e7a6c1837bd 100644 --- a/src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr +++ b/src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr @@ -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 |
