Skip to content

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

Merged

Conversation

lolbinarycat
Copy link
Contributor

fixes #139008

@rustbot
Copy link
Collaborator

rustbot commented Mar 31, 2025

r? @workingjubilee

rustbot has assigned @workingjubilee.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 31, 2025
@@ -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
Copy link
Member

@workingjubilee workingjubilee Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just say

Suggested change
/// 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

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see.

@tgross35
Copy link
Contributor

Cc @RalfJung, your kind of docs :)

@RalfJung
Copy link
Member

I don't see the suggestion applied?
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 29, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@lolbinarycat
Copy link
Contributor Author

@RalfJung oops, forgot to push.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 29, 2025
@lolbinarycat lolbinarycat force-pushed the docs-wrapping_offset-provenance-139008 branch from 249fa89 to 851decd Compare April 29, 2025 19:29
@RalfJung
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 29, 2025

📌 Commit 851decd has been approved by RalfJung

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 30, 2025
…provenance-139008, r=RalfJung

mention provenance in the pointer::wrapping_offset docs

fixes rust-lang#139008
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
…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
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 30, 2025
…provenance-139008, r=RalfJung

mention provenance in the pointer::wrapping_offset docs

fixes rust-lang#139008
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
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
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
…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
@bors bors merged commit aeec053 into rust-lang:master Apr 30, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 30, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pointer::wrapping_offset should mention provenance
6 participants