Skip to content

BorrowedBuf: Update outdated safety comments in set_init users.#155314

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
briansmith:b/comments
Apr 15, 2026
Merged

BorrowedBuf: Update outdated safety comments in set_init users.#155314
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
briansmith:b/comments

Conversation

@briansmith
Copy link
Copy Markdown
Contributor

@briansmith briansmith commented Apr 14, 2026

These comments appear to have been written before BorrowedBuf's init tracking was simplified in
#150129. The BufWriter comment of the usage within BufWriter will be handled separately.

CC #78485, #117693.

@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 Apr 14, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 14, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates

@rustbot

This comment has been minimized.

These comments appear to have been written before `BorrowedBuf`'s
init tracking was simplified in
rust-lang#150129. The `BufWriter` comment
of the usage within `BufWriter` will be handled separately.
@joshtriplett
Copy link
Copy Markdown
Member

joshtriplett commented Apr 14, 2026

This looks good to me, and seems like an improvement.

r=me when CI passed. (It's just comments, so I don't expect CI to have anything to say, but I have the habit these days of not just r+ing something even if I think it couldn't possibly fail CI.)

@joshtriplett
Copy link
Copy Markdown
Member

@bors d+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 14, 2026

Unknown command "d+". Run @bors help to see available commands.

@joshtriplett
Copy link
Copy Markdown
Member

@bors delegate+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 14, 2026

✌️ @briansmith, you can now approve this pull request!

If @joshtriplett told you to "r=me" after making some further change, then please make that change and post @bors r=joshtriplett.

@briansmith
Copy link
Copy Markdown
Contributor Author

@bors r=joshtriplett

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 14, 2026

📌 Commit 10cff15 has been approved by joshtriplett

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 Apr 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 15, 2026
Rollup of 13 pull requests

Successful merges:

 - #154882 (Gate tuple const params behind `min_adt_const_params` feature)
 - #155259 (explicit-tail-calls: disable two tests on LoongArch)
 - #155293 (fix arch names in cfg pretty printer)
 - #155314 (`BorrowedBuf`: Update outdated safety comments in `set_init` users.)
 - #153469 (docs: clarify path search behavior in std::process::Command::new)
 - #154765 (Clarify ascii whitespace exclusion of vertical tab in the doc)
 - #155172 (Some small nits for supertrait_item_shadowing, and additional testing)
 - #155279 (Test/lexer unicode pattern white space)
 - #155280 (Tests for precise-capture through RPIT and TAIT)
 - #155301 (Delete unused `rustc_trait_selection` errors.)
 - #155303 (remove ibraheemdev from review rotation)
 - #155304 (remove PointeeParser)
 - #155319 (Remove dead diagnostic structs.)
@rust-bors rust-bors Bot merged commit 85c11f6 into rust-lang:main Apr 15, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 15, 2026
rust-timer added a commit that referenced this pull request Apr 15, 2026
Rollup merge of #155314 - briansmith:b/comments, r=joshtriplett

`BorrowedBuf`: Update outdated safety comments in `set_init` users.

These comments appear to have been written before `BorrowedBuf`'s init tracking was simplified in
#150129. The `BufWriter` comment of the usage within `BufWriter` will be handled separately.

CC #78485, #117693.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 2, 2026
…pratt

`bufreader::Buffer`: Remove leftover note about `initialized` field

Just a boring little doc fix! : v)

rust-lang#150129 reworked the `initialized` field to be a `bool` instead of a `usize`.
And then rust-lang#155314 reworked this field's comment (among other things).
But, there's still a leftover note in the comment, which no longer makes sense:
``Note that while this often the same as `filled`, it doesn't need to be.``
This is referencing that back when `initialized` was a `usize`, it was common for it to have the same value as `filled`.

----

Fun fact: there's a typo in the note too! It's missing an "is" before or after "often".
rust-timer added a commit that referenced this pull request May 2, 2026
Rollup merge of #156026 - InsertCreativityHere:patch-1, r=jhpratt

`bufreader::Buffer`: Remove leftover note about `initialized` field

Just a boring little doc fix! : v)

#150129 reworked the `initialized` field to be a `bool` instead of a `usize`.
And then #155314 reworked this field's comment (among other things).
But, there's still a leftover note in the comment, which no longer makes sense:
``Note that while this often the same as `filled`, it doesn't need to be.``
This is referencing that back when `initialized` was a `usize`, it was common for it to have the same value as `filled`.

----

Fun fact: there's a typo in the note too! It's missing an "is" before or after "often".
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