Improve pointer offset method docs#63297
Conversation
|
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
gnzlbg
left a comment
There was a problem hiding this comment.
TIL that we promise that pointer-to-integer casts erase provenance information. I'm not sure how this can be implemented given that C does allow propagating provenance in pointer-to-integer casts, but since this is not a new guarantee, this LGTM.
I added this some releases ago and it was my understanding that it reflects our current semantics. It looks like C is moving in the same direction. And in particular LLVM pretty much has no other choice; tons of LLVM optimizations (most importantly large chunks of what GVN does) are invalid if integers have provenance. This currently leads to LLVM miscompiling things. |
|
@bors r+ rollup |
|
📌 Commit 0dc9e2a has been approved by |
Rollup of 10 pull requests Successful merges: - #62108 (Use sharded maps for queries) - #63297 (Improve pointer offset method docs) - #63306 (Adapt AddRetag for shallow retagging) - #63406 (Suggest using a qualified path in patterns with inconsistent bindings) - #63431 (Revert "Simplify MIR generation for logical ops") - #63449 (resolve: Remove remaining special cases from built-in macros) - #63461 (docs: add stdlib env::var(_os) panic) - #63473 (Regression test for #56870) - #63474 (Add tests for issue #53598 and #57700) - #63480 (Fixes #63477) Failed merges: r? @ghost
Rollup of 9 pull requests Successful merges: - #62108 (Use sharded maps for queries) - #63297 (Improve pointer offset method docs) - #63406 (Suggest using a qualified path in patterns with inconsistent bindings) - #63431 (Revert "Simplify MIR generation for logical ops") - #63449 (resolve: Remove remaining special cases from built-in macros) - #63461 (docs: add stdlib env::var(_os) panic) - #63473 (Regression test for #56870) - #63474 (Add tests for issue #53598 and #57700) - #63480 (Fixes #63477) Failed merges: r? @ghost
Cc @rkruppe @gnzlbg