-
Notifications
You must be signed in to change notification settings - Fork 13.3k
mention provenance in the pointer::wrapping_offset docs #139192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mention provenance in the pointer::wrapping_offset docs #139192
Conversation
rustbot has assigned @workingjubilee. Use |
library/core/src/ptr/const_ptr.rs
Outdated
@@ -483,7 +483,7 @@ impl<T: ?Sized> *const T { | |||
/// | |||
/// This operation itself is always safe, but using the resulting pointer is not. | |||
/// | |||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not | |||
/// The resulting pointer "remembers"[^1] the [allocated object] that `self` points to; it must not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just say
/// The resulting pointer "remembers"[^1] the [allocated object] that `self` points to; it must not | |
/// The resulting pointer has the provenance of the [allocated object] that `self` points to; it must not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk, does that flow correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for provenance actually quotes the current phrasing:
As another example, consider that wrapping_offset is documented to “remember” the allocated object that the original pointer points to, even if it is offset far outside the memory range occupied by that allocated object.
If we change the phrasing of the wrapping_offset
docs, this example will become circular and awkward, so I think it's best to leave it as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see.
Cc @RalfJung, your kind of docs :) |
I don't see the suggestion applied? |
Reminder, once the PR becomes ready for a review, use |
249fa89
to
851decd
Compare
Thanks! @bors r+ rollup |
…provenance-139008, r=RalfJung mention provenance in the pointer::wrapping_offset docs fixes rust-lang#139008
…enton Rollup of 9 pull requests Successful merges: - rust-lang#139192 (mention provenance in the pointer::wrapping_offset docs) - rust-lang#140176 (Fix linking statics on Arm64EC) - rust-lang#140404 (rm `TypeVistable` impls for `Canonical`) - rust-lang#140437 (enable msa feature for mips in codegen tests) - rust-lang#140438 (Add `rust.debug-assertions-tools` option) - rust-lang#140446 (chore: fix some tests) - rust-lang#140470 (CI: rfl: move job forward to Linux v6.15-rc4) - rust-lang#140476 (chore: delete unused ui/auxiliary crates) - rust-lang#140481 (Require sanitizers be enabled for asan_odr_windows.rs) r? `@ghost` `@rustbot` modify labels: rollup
…provenance-139008, r=RalfJung mention provenance in the pointer::wrapping_offset docs fixes rust-lang#139008
Rollup of 12 pull requests Successful merges: - rust-lang#136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`) - rust-lang#138087 (Initial implementation of `core_float_math`) - rust-lang#139059 (uses_power_alignment: wording tweaks) - rust-lang#139192 (mention provenance in the pointer::wrapping_offset docs) - rust-lang#140312 (Improve pretty-printing of braces) - rust-lang#140404 (rm `TypeVistable` impls for `Canonical`) - rust-lang#140437 (enable msa feature for mips in codegen tests) - rust-lang#140438 (Add `rust.debug-assertions-tools` option) - rust-lang#140439 (miri: algebraic intrinsics: bring back float non-determinism) - rust-lang#140445 (Treat ManuallyDrop as ~const Destruct) - rust-lang#140446 (chore: fix some tests) - rust-lang#140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`) Failed merges: - rust-lang#140456 (Fix test simd/extract-insert-dyn on s390x) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`) - rust-lang#139059 (uses_power_alignment: wording tweaks) - rust-lang#139192 (mention provenance in the pointer::wrapping_offset docs) - rust-lang#140312 (Improve pretty-printing of braces) - rust-lang#140404 (rm `TypeVistable` impls for `Canonical`) - rust-lang#140437 (enable msa feature for mips in codegen tests) - rust-lang#140438 (Add `rust.debug-assertions-tools` option) - rust-lang#140439 (miri: algebraic intrinsics: bring back float non-determinism) - rust-lang#140445 (Treat ManuallyDrop as ~const Destruct) - rust-lang#140446 (chore: fix some tests) - rust-lang#140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139192 - lolbinarycat:docs-wrapping_offset-provenance-139008, r=RalfJung mention provenance in the pointer::wrapping_offset docs fixes rust-lang#139008
fixes #139008