Skip to content

Add safety comments in alloc::Wtf8 - #161292

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
yilin0518:fix_alloc_wtf8
Aug 22, 2026
Merged

Add safety comments in alloc::Wtf8#161292
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
yilin0518:fix_alloc_wtf8

Conversation

@yilin0518

@yilin0518 yilin0518 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

This PR follow up #160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every Untriged mentioned in #160824.

Before this PR, #161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.

@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 Aug 18, 2026
@rustbot

rustbot commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

r? @clarfonthey

rustbot has assigned @clarfonthey.
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, clarfonthey, nia-e, tgross35

@yilin0518 yilin0518 changed the title Add safety comments in alloc/Wtf8 Add safety comments in alloc::Wtf8 Aug 18, 2026
Comment thread library/alloc/src/wtf8/mod.rs Outdated
use crate::vec::Vec;

/// An owned, growable string of well-formed WTF-8 data.
/// An owned, growable string of [well-formed WTF-8](https://wtf-8.codeberg.page/#well-formed) data.

@clarfonthey clarfonthey Aug 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would you mind updating the links in core::wtf8 to use this link as well? Currently they link to Simon's GitHub repo, which appears to be an older version.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No problem, I can fix these links.

@clarfonthey

Copy link
Copy Markdown
Contributor

Thank you! One small comment about updating the links so they match, otherwise looks good to me.

@yilin0518

Copy link
Copy Markdown
Contributor Author

@clarfonthey I have update the links in core::Wtf8, you can take a look. Thank you for your review!

@clarfonthey

Copy link
Copy Markdown
Contributor

Thank you!

@bors r+

@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 8fe7ae5 has been approved by clarfonthey

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 Aug 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
…nthey

Add safety comments in alloc::Wtf8

This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824.

Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
…nthey

Add safety comments in alloc::Wtf8

This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824.

Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
…nthey

Add safety comments in alloc::Wtf8

This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824.

Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 22, 2026
…nthey

Add safety comments in alloc::Wtf8

This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824.

Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.
rust-bors Bot pushed a commit that referenced this pull request Aug 22, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #151061 (Build rustc and codegen backends with -Zembed-metadata=no)
 - #157949 (Allow self in const generics)
 - #158588 (trait_selection: fix assumptions-on-binders diagnostics)
 - #159954 (core: implement float conversion methods)
 - #160136 (Add `Default` implementation for `std::sync::Once`)
 - #160835 (resolver diagnostics: don't swallow labels and point out  similar items as a note, not a label)
 - #161048 (Improve the ABI between the panic runtime and libstd)
 - #161292 (Add safety comments in alloc::Wtf8)
 - #161444 (Add some `rustc_type_ir` comments)
 - #161465 (Remove leftover immediate creation)
 - #152433 (Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`)
 - #159098 (Add Arc/Rc::strong_count_from_raw)
 - #159282 (Update documentation for `-Zdump-dep-graph`)
 - #161401 (Remove fields from TypeKind: Bool, Char, Float and Int)
 - #161431 (bootstrap: (offload) be stricter about selected compiler and paths)
 - #161451 (Avoid arming the Windows TLS destructor guard in fibers)
 - #161463 (Add myself to mailmap)
 - #161476 (Use bitset for locals_with_use_data)

Failed merges:

 - #161443 (add internal DSL for testing binders)
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 22, 2026
…nthey

Add safety comments in alloc::Wtf8

This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824.

Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 22, 2026
…nthey

Add safety comments in alloc::Wtf8

This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824.

Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 22, 2026
…nthey

Add safety comments in alloc::Wtf8

This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824.

Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.
rust-bors Bot pushed a commit that referenced this pull request Aug 22, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #151061 (Build rustc and codegen backends with -Zembed-metadata=no)
 - #154992 (Error on projection of dyn noncompat type in old trait solver)
 - #157949 (Allow self in const generics)
 - #158588 (trait_selection: fix assumptions-on-binders diagnostics)
 - #159954 (core: implement float conversion methods)
 - #160136 (Add `Default` implementation for `std::sync::Once`)
 - #160835 (resolver diagnostics: don't swallow labels and point out  similar items as a note, not a label)
 - #161048 (Improve the ABI between the panic runtime and libstd)
 - #161292 (Add safety comments in alloc::Wtf8)
 - #161444 (Add some `rustc_type_ir` comments)
 - #161465 (Remove leftover immediate creation)
 - #159098 (Add Arc/Rc::strong_count_from_raw)
 - #159282 (Update documentation for `-Zdump-dep-graph`)
 - #161401 (Remove fields from TypeKind: Bool, Char, Float and Int)
 - #161431 (bootstrap: (offload) be stricter about selected compiler and paths)
 - #161451 (Avoid arming the Windows TLS destructor guard in fibers)
 - #161463 (Add myself to mailmap)
 - #161476 (Use bitset for locals_with_use_data)
 - #161483 (Warn about running ui-fulldeps tests in stage 1)

Failed merges:

 - #161443 (add internal DSL for testing binders)
@rust-bors
rust-bors Bot merged commit 0d32bcb into rust-lang:main Aug 22, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 22, 2026
Rollup merge of #161292 - yilin0518:fix_alloc_wtf8, r=clarfonthey

Add safety comments in alloc::Wtf8

This PR follow up #160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in #160824.

Before this PR, #161271 had add some safety sections for Wtf8 in core.

I'm looking forward to your review and give me any feedback to improve this PR.
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.

3 participants