Skip to content

Add safety comments for alloc::string - #163463

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
yilin0518:fix_tidy_string
Sep 29, 2026
Merged

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

Conversation

@yilin0518

@yilin0518 yilin0518 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This PR serves as a following PR with #163445 . This PR replace // ignore-tidy-undocumented-unsafe with concrete safety comments. Every // ignore-tidy-undocumented-unsafe in alloc::string is checked. This PR only contains a file for ease of review.

@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 Sep 29, 2026
@rustbot

rustbot commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

r? @jhpratt

rustbot has assigned @jhpratt.
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 Darksonn, JohnTitor, Mark-Simulacrum, clarfonthey, jhpratt

@rust-log-analyzer

This comment has been minimized.

@jhpratt

jhpratt commented Sep 29, 2026

Copy link
Copy Markdown
Member

The error from CI is

error: expected a trait, found type
##[error]    --> /checkout/library/alloc/src/string.rs:2779:6
     |
2779 | impl const Default for String {
     |      ^^^^^^^^^^^^^

This is probably rustfmt being out of date. If you change that around (to const impl Default as it currently is), CI should go green and I'll take a look.

@yilin0518

Copy link
Copy Markdown
Contributor Author

This is probably rustfmt being out of date. If you change that around (to const impl Default as it currently is), CI should go green and I'll take a look.

I change that line of code by mistake(by using document formatting in vscode). Now it should be no problem.

@jhpratt jhpratt 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.

I figured because I have done the exact same thing in the past.

LGTM with the one change.

View changes since this review

Comment thread library/alloc/src/string.rs Outdated
@jhpratt

jhpratt commented Sep 29, 2026

Copy link
Copy Markdown
Member

Thanks!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2ccceb0 has been tentatively approved by jhpratt

It will be put into the queue for this repository once PR CI succeeds.

@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 Sep 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 29, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - #163401 (Clarify some things in the docs of `Global`)
 - #163463 (Add safety comments for alloc::string)
 - #163474 (Fix ICE when use tree appears in docs)
@rust-bors
rust-bors Bot merged commit 919152d into rust-lang:main Sep 29, 2026
13 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Sep 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 29, 2026
Rollup merge of #163463 - yilin0518:fix_tidy_string, r=jhpratt

Add safety comments for alloc::string

This PR serves as a following PR with #163445 . This PR replace `// ignore-tidy-undocumented-unsafe` with concrete safety comments. Every `// ignore-tidy-undocumented-unsafe` in `alloc::string` is checked. This PR only contains a file for ease of review.
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Sep 30, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#163401 (Clarify some things in the docs of `Global`)
 - rust-lang/rust#163463 (Add safety comments for alloc::string)
 - rust-lang/rust#163474 (Fix ICE when use tree appears in docs)
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