Skip to content

Commit a52eb32

Browse files
authored
Rollup merge of #95852 - niluxv:strict-provenance-lint-fixup, r=Dylan-DPC
Fix missing space in lossy provenance cast lint See #95599 (comment)
2 parents 0b87143 + 1834c21 commit a52eb32

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_typeck/src/check/cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
10121012
err.help(msg);
10131013
}
10141014
err.help(
1015-
"if you can't comply with strict provenance and need to expose the pointer\
1015+
"if you can't comply with strict provenance and need to expose the pointer \
10161016
provenance you can use `.expose_addr()` instead"
10171017
);
10181018

src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ note: the lint level is defined here
99
|
1010
LL | #![deny(lossy_provenance_casts)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^
12-
= help: if you can't comply with strict provenance and need to expose the pointerprovenance you can use `.expose_addr()` instead
12+
= help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
1313

1414
error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `u32`
1515
--> $DIR/lint-strict-provenance-lossy-casts.rs:9:22
1616
|
1717
LL | let addr_32bit = &x as *const u8 as u32;
1818
| ^^^^^^^^^^^^^^^^^^^^^^ help: use `.addr()` to obtain the address of a pointer: `(&x as *const u8).addr() as u32`
1919
|
20-
= help: if you can't comply with strict provenance and need to expose the pointerprovenance you can use `.expose_addr()` instead
20+
= help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
2121

2222
error: aborting due to 2 previous errors
2323

0 commit comments

Comments
 (0)