You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #122935 - RalfJung:with-exposed-provenance, r=Amanieu
rename ptr::from_exposed_addr -> ptr::with_exposed_provenance
As discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/To.20expose.20or.20not.20to.20expose/near/427757066).
The old name, `from_exposed_addr`, makes little sense as it's not the address that is exposed, it's the provenance. (`ptr.expose_addr()` stays unchanged as we haven't found a better option yet. The intended interpretation is "expose the provenance and return the address".)
The new name nicely matches `ptr::without_provenance`.
Copy file name to clipboardexpand all lines: compiler/rustc_hir_typeck/messages.ftl
+1-1
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ hir_typeck_invalid_callee = expected function, found {$ty}
86
86
hir_typeck_lossy_provenance_int2ptr =
87
87
strict provenance disallows casting integer `{$expr_ty}` to pointer `{$cast_ty}`
88
88
.suggestion = use `.with_addr()` to adjust a valid pointer in the same allocation, to this address
89
-
.help = if you can't comply with strict provenance and don't have a pointer with the correct provenance you can use `std::ptr::from_exposed_addr()` instead
89
+
.help = if you can't comply with strict provenance and don't have a pointer with the correct provenance you can use `std::ptr::with_exposed_provenance()` instead
90
90
91
91
hir_typeck_lossy_provenance_ptr2int =
92
92
under strict provenance it is considered bad style to cast pointer `{$expr_ty}` to integer `{$cast_ty}`
0 commit comments