Skip to content

make the safety documentation consistent in Ptr module - #164241

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
yilin0518:fix_ptr_unsafe
Nov 4, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
yilin0518:fix_ptr_unsafe

Conversation

@yilin0518

@yilin0518 yilin0518 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

This PR only contains doc changes. Similar to PR #164213 , "make the safety documentation consistent in task::LocalWaker", the reason for this is that I found the current documentation has different representations. So I refactored this documentation in the ptr module and kept only the most commonly used pattern.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2026
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 13, 2026
@rustbot

rustbot commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from JohnTitor, Mark-Simulacrum

@rust-log-analyzer

This comment has been minimized.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 31, 2026
…Titor

Add safety section for from_utf8_unchecked/from_raw_parts

This PR only contains doc changes and similar to rust-lang#164213, rust-lang#164241. This PR add `# Safety` section for `from_utf8_unchecked(mut)` and `from_raw_parts(mut)`. This can unify the safety doc in `str` thus all `pub unsafe fn` have `# Safety` section.

Thank you for your review.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 31, 2026
…Titor

Add safety section for from_utf8_unchecked/from_raw_parts

This PR only contains doc changes and similar to rust-lang#164213, rust-lang#164241. This PR add `# Safety` section for `from_utf8_unchecked(mut)` and `from_raw_parts(mut)`. This can unify the safety doc in `str` thus all `pub unsafe fn` have `# Safety` section.

Thank you for your review.
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
Rollup merge of #165019 - yilin0518:unify-unsafe-str, r=JohnTitor

Add safety section for from_utf8_unchecked/from_raw_parts

This PR only contains doc changes and similar to #164213, #164241. This PR add `# Safety` section for `from_utf8_unchecked(mut)` and `from_raw_parts(mut)`. This can unify the safety doc in `str` thus all `pub unsafe fn` have `# Safety` section.

Thank you for your review.

@JohnTitor JohnTitor left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7cd081e has been approved by JohnTitor

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 3, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 3, 2026
make the safety documentation consistent in Ptr module

This PR only contains doc changes. Similar to PR rust-lang#164213 , "make the safety documentation consistent in task::LocalWaker", the reason for this is that I found the current documentation has different representations. So I refactored this documentation in the `ptr` module and kept only the most commonly used pattern.
rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #149245 (Make inline attributes apply to the generated `poll` in async fn)
 - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added)
 - #165109 (Avoid building a region map when erasing bound regions)
 - #163393 (std: Use getexecpath() for current_exe() on OpenBSD)
 - #164896 (offload: pass the linked device image to the host pass)
 - #165358 (Reenable some cg_gcc tests that were disabled)
 - #165371 (Don't use `llvm_type` as the type of `static`s.)
 - #162232 (Replace `builtin #` with `k#`)
 - #162608 (Avoid oscillating line wrapping due to symbol indices)
 - #164241 (make the safety documentation consistent in Ptr module)
 - #165029 (Use `MalformedLintAttributeInput` in more places)
 - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test)
 - #165230 (Fix rigidity assertion ICE)
 - #165374 (Refactorings in preparation for the move trait)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 3, 2026
make the safety documentation consistent in Ptr module

This PR only contains doc changes. Similar to PR rust-lang#164213 , "make the safety documentation consistent in task::LocalWaker", the reason for this is that I found the current documentation has different representations. So I refactored this documentation in the `ptr` module and kept only the most commonly used pattern.
rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #149245 (Make inline attributes apply to the generated `poll` in async fn)
 - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added)
 - #165109 (Avoid building a region map when erasing bound regions)
 - #163393 (std: Use getexecpath() for current_exe() on OpenBSD)
 - #165358 (Reenable some cg_gcc tests that were disabled)
 - #165371 (Don't use `llvm_type` as the type of `static`s.)
 - #162232 (Replace `builtin #` with `k#`)
 - #162608 (Avoid oscillating line wrapping due to symbol indices)
 - #164241 (make the safety documentation consistent in Ptr module)
 - #165029 (Use `MalformedLintAttributeInput` in more places)
 - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test)
 - #165230 (Fix rigidity assertion ICE)
 - #165374 (Refactorings in preparation for the move trait)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 3, 2026
make the safety documentation consistent in Ptr module

This PR only contains doc changes. Similar to PR rust-lang#164213 , "make the safety documentation consistent in task::LocalWaker", the reason for this is that I found the current documentation has different representations. So I refactored this documentation in the `ptr` module and kept only the most commonly used pattern.
rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #149245 (Make inline attributes apply to the generated `poll` in async fn)
 - #163495 (Parallelize AST -> HIR lowering)
 - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added)
 - #165109 (Avoid building a region map when erasing bound regions)
 - #163393 (std: Use getexecpath() for current_exe() on OpenBSD)
 - #163625 (Add a lint helper attribute namespace )
 - #164414 (Add `let_underscore_drop_guard` lint.)
 - #165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint)
 - #165351 (delegation: insert probing adjustments before args check adjustments)
 - #165358 (Reenable some cg_gcc tests that were disabled)
 - #165377 (Make `no_implicit_prelude` not suppress tool attributes)
 - #165397 (Add codegen test for unused match arms removed after inlining)
 - #165398 (Rework parallel reproducibility tests)
 - #162608 (Avoid oscillating line wrapping due to symbol indices)
 - #164241 (make the safety documentation consistent in Ptr module)
 - #165029 (Use `MalformedLintAttributeInput` in more places)
 - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test)
 - #165230 (Fix rigidity assertion ICE)
 - #165293 (unstable-book: update default-visibility.md to link to tracking issue)
 - #165374 (Refactorings in preparation for the move trait)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 3, 2026
make the safety documentation consistent in Ptr module

This PR only contains doc changes. Similar to PR rust-lang#164213 , "make the safety documentation consistent in task::LocalWaker", the reason for this is that I found the current documentation has different representations. So I refactored this documentation in the `ptr` module and kept only the most commonly used pattern.
rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #165416 (fix unsoundness when compiling `[diverging_const; 0]`)
 - #149245 (Make inline attributes apply to the generated `poll` in async fn)
 - #163495 (Parallelize AST -> HIR lowering)
 - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added)
 - #165109 (Avoid building a region map when erasing bound regions)
 - #163393 (std: Use getexecpath() for current_exe() on OpenBSD)
 - #163625 (Add a lint helper attribute namespace )
 - #164414 (Add `let_underscore_drop_guard` lint.)
 - #165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint)
 - #165351 (delegation: insert probing adjustments before args check adjustments)
 - #165358 (Reenable some cg_gcc tests that were disabled)
 - #165377 (Make `no_implicit_prelude` not suppress tool attributes)
 - #165397 (Add codegen test for unused match arms removed after inlining)
 - #165398 (Rework parallel reproducibility tests)
 - #162608 (Avoid oscillating line wrapping due to symbol indices)
 - #164241 (make the safety documentation consistent in Ptr module)
 - #165029 (Use `MalformedLintAttributeInput` in more places)
 - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test)
 - #165230 (Fix rigidity assertion ICE)
 - #165293 (unstable-book: update default-visibility.md to link to tracking issue)
 - #165374 (Refactorings in preparation for the move trait)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 3, 2026
make the safety documentation consistent in Ptr module

This PR only contains doc changes. Similar to PR rust-lang#164213 , "make the safety documentation consistent in task::LocalWaker", the reason for this is that I found the current documentation has different representations. So I refactored this documentation in the `ptr` module and kept only the most commonly used pattern.
rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #149245 (Make inline attributes apply to the generated `poll` in async fn)
 - #163495 (Parallelize AST -> HIR lowering)
 - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added)
 - #165109 (Avoid building a region map when erasing bound regions)
 - #163393 (std: Use getexecpath() for current_exe() on OpenBSD)
 - #163625 (Add a lint helper attribute namespace )
 - #164414 (Add `let_underscore_drop_guard` lint.)
 - #165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint)
 - #165351 (delegation: insert probing adjustments before args check adjustments)
 - #165358 (Reenable some cg_gcc tests that were disabled)
 - #165377 (Make `no_implicit_prelude` not suppress tool attributes)
 - #165397 (Add codegen test for unused match arms removed after inlining)
 - #165398 (Rework parallel reproducibility tests)
 - #162608 (Avoid oscillating line wrapping due to symbol indices)
 - #164241 (make the safety documentation consistent in Ptr module)
 - #165029 (Use `MalformedLintAttributeInput` in more places)
 - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test)
 - #165230 (Fix rigidity assertion ICE)
 - #165293 (unstable-book: update default-visibility.md to link to tracking issue)
 - #165374 (Refactorings in preparation for the move trait)
rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #149245 (Make inline attributes apply to the generated `poll` in async fn)
 - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added)
 - #165109 (Avoid building a region map when erasing bound regions)
 - #163393 (std: Use getexecpath() for current_exe() on OpenBSD)
 - #163625 (Add a lint helper attribute namespace )
 - #164414 (Add `let_underscore_drop_guard` lint.)
 - #165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint)
 - #165351 (delegation: insert probing adjustments before args check adjustments)
 - #165358 (Reenable some cg_gcc tests that were disabled)
 - #165377 (Make `no_implicit_prelude` not suppress tool attributes)
 - #165397 (Add codegen test for unused match arms removed after inlining)
 - #165398 (Rework parallel reproducibility tests)
 - #162232 (Replace `builtin #` with `k#`)
 - #162608 (Avoid oscillating line wrapping due to symbol indices)
 - #164241 (make the safety documentation consistent in Ptr module)
 - #164258 (clarify when `Vec::into_boxed_slice()` is in-place)
 - #165029 (Use `MalformedLintAttributeInput` in more places)
 - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test)
 - #165230 (Fix rigidity assertion ICE)
 - #165293 (unstable-book: update default-visibility.md to link to tracking issue)
 - #165374 (Refactorings in preparation for the move trait)
 - #165421 (another Enzyme submodule update for nested autodiff)
@rust-bors
rust-bors Bot merged commit bc59e31 into rust-lang:main Nov 4, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Nov 4, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 4, 2026
Rollup merge of #164241 - yilin0518:fix_ptr_unsafe, r=JohnTitor

make the safety documentation consistent in Ptr module

This PR only contains doc changes. Similar to PR #164213 , "make the safety documentation consistent in task::LocalWaker", the reason for this is that I found the current documentation has different representations. So I refactored this documentation in the `ptr` module and kept only the most commonly used pattern.
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Nov 4, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - rust-lang/rust#149245 (Make inline attributes apply to the generated `poll` in async fn)
 - rust-lang/rust#164304 ([perf] Reuse CanonicalVarKinds if no new variables were added)
 - rust-lang/rust#165109 (Avoid building a region map when erasing bound regions)
 - rust-lang/rust#163393 (std: Use getexecpath() for current_exe() on OpenBSD)
 - rust-lang/rust#163625 (Add a lint helper attribute namespace )
 - rust-lang/rust#164414 (Add `let_underscore_drop_guard` lint.)
 - rust-lang/rust#165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint)
 - rust-lang/rust#165351 (delegation: insert probing adjustments before args check adjustments)
 - rust-lang/rust#165358 (Reenable some cg_gcc tests that were disabled)
 - rust-lang/rust#165377 (Make `no_implicit_prelude` not suppress tool attributes)
 - rust-lang/rust#165397 (Add codegen test for unused match arms removed after inlining)
 - rust-lang/rust#165398 (Rework parallel reproducibility tests)
 - rust-lang/rust#162232 (Replace `builtin #` with `k#`)
 - rust-lang/rust#162608 (Avoid oscillating line wrapping due to symbol indices)
 - rust-lang/rust#164241 (make the safety documentation consistent in Ptr module)
 - rust-lang/rust#164258 (clarify when `Vec::into_boxed_slice()` is in-place)
 - rust-lang/rust#165029 (Use `MalformedLintAttributeInput` in more places)
 - rust-lang/rust#165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test)
 - rust-lang/rust#165230 (Fix rigidity assertion ICE)
 - rust-lang/rust#165293 (unstable-book: update default-visibility.md to link to tracking issue)
 - rust-lang/rust#165374 (Refactorings in preparation for the move trait)
 - rust-lang/rust#165421 (another Enzyme submodule update for nested autodiff)
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.

4 participants