Skip to content

Update expect messages in tcp.rs doc examples to follow the style guide - #160538

Open
CacinieP wants to merge 1 commit into
rust-lang:mainfrom
CacinieP:expect-tcp-precondition-style
Open

Update expect messages in tcp.rs doc examples to follow the style guide#160538
CacinieP wants to merge 1 commit into
rust-lang:mainfrom
CacinieP:expect-tcp-precondition-style

Conversation

@CacinieP

@CacinieP CacinieP commented Aug 5, 2026

Copy link
Copy Markdown

Related issue: #159751

Rewords the .expect(...) messages in the TcpStream/TcpListener doc examples in library/std/src/net/tcp.rs to follow the "expect as precondition" style guide introduced in #96033.

Examples of the change:

  • "set_nodelay call failed""set_nodelay should succeed"
  • "could not set TTL""set_ttl should succeed"
  • "Cannot set non-blocking""set_nonblocking should succeed"

19 doc-example messages updated, all in doc comments (///). Doc-only change, no behavior change.

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

rustbot commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @jhpratt (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 13 candidates
  • Random selection from 6 candidates

@rustbot

This comment has been minimized.

Reword the `.expect(...)` messages in the TcpStream/TcpListener doc
examples in library/std/src/net/tcp.rs to follow the 'expect as
precondition' style from the std library guidance (describe why the
operation is expected to succeed, rather than restating the failure).

Examples:
  "set_nodelay call failed"   -> "set_nodelay should succeed"
  "could not set TTL"         -> "set_ttl should succeed"
  "Cannot set non-blocking"   -> "set_nonblocking should succeed"

Doc-only change, no behavior change.
@CacinieP
CacinieP force-pushed the expect-tcp-precondition-style branch from 7eded66 to b568775 Compare August 5, 2026 03:22
@CacinieP

CacinieP commented Aug 5, 2026

Copy link
Copy Markdown
Author

Done — removed the issue references from the commit message. They now only appear in the PR description.

@jhpratt

jhpratt commented Aug 5, 2026

Copy link
Copy Markdown
Member

In the future, note that the project's LLM policy has been formally accepted. Outputs from LLMs must not be made public (such as in PR descriptions and comments here) except in very narrow situations.

With that said, it's silly to close a trivial PR like this for that reason.

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit b568775 has been approved by jhpratt

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 10. This pull request will be tested once the tree is reopened.

Reason for tree closure: manually handling queue due to backlog

@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 5, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 5, 2026
…tyle, r=jhpratt

Update expect messages in tcp.rs doc examples to follow the style guide

Related issue: rust-lang#159751

Rewords the `.expect(...)` messages in the `TcpStream`/`TcpListener` doc examples in `library/std/src/net/tcp.rs` to follow the "expect as precondition" style guide introduced in rust-lang#96033.

Examples of the change:
- `"set_nodelay call failed"` → `"set_nodelay should succeed"`
- `"could not set TTL"` → `"set_ttl should succeed"`
- `"Cannot set non-blocking"` → `"set_nonblocking should succeed"`

19 doc-example messages updated, all in doc comments (`///`). Doc-only change, no behavior change.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 5, 2026
…tyle, r=jhpratt

Update expect messages in tcp.rs doc examples to follow the style guide

Related issue: rust-lang#159751

Rewords the `.expect(...)` messages in the `TcpStream`/`TcpListener` doc examples in `library/std/src/net/tcp.rs` to follow the "expect as precondition" style guide introduced in rust-lang#96033.

Examples of the change:
- `"set_nodelay call failed"` → `"set_nodelay should succeed"`
- `"could not set TTL"` → `"set_ttl should succeed"`
- `"Cannot set non-blocking"` → `"set_nonblocking should succeed"`

19 doc-example messages updated, all in doc comments (`///`). Doc-only change, no behavior change.
rust-bors Bot pushed a commit that referenced this pull request Aug 5, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #158147 (std: fix stack buffer overflow in Windows junction_point)
 - #159784 (Hint that memchr returns an in-bounds index)
 - #160130 (Select cache values to verify by key fingerprint, not value fingerprint)
 - #160343 (Rename `OutlivesPredicate` to `OutlivesClause`)
 - #160360 (Remove rustc_middle dependency on rustc_hir_pretty)
 - #160387 (rustc_codegen_ssa: Correctly apply the static `--jobs-backend` limit to backend parallelism)
 - #160422 (move mir-opt miri tests to CI logic)
 - #160444 (Avoid resolving path keywords outside `TypeNS`)
 - #160510 (Resolver: (un)tracked borrows for `CmRefCell` made safe my unsafe speculative flag)
 - #155424 ([blocked] Link to proposed LLM policy in CONTRIBUTING and pull request template)
 - #158726 (std: move futex implementations into sys::sync::futex)
 - #159225 (Split IncrCompSession out of Session)
 - #159820 (Make the `rustc_unsafe_specialization_marker` attribute actually `unsafe`)
 - #160198 (Rework `smallest_range_containing` to handle duplicates)
 - #160362 (Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`)
 - #160390 (autodiff: Handle slice-tailed DSTs in type trees)
 - #160420 (Suggest `cast_signed()` for overflowing signed integer literals)
 - #160520 (Add some tests for specialization)
 - #160522 (fix(bootstrap): Normalize the names of proc macro dependency crates)
 - #160531 (docs: fix typo in AllowExprMetavar comment)
 - #160538 (Update expect messages in tcp.rs doc examples to follow the style guide)
 - #160548 (bootstrap: Register `coverage-map` and `coverage-run` aliases via a separate step)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 5, 2026
…tyle, r=jhpratt

Update expect messages in tcp.rs doc examples to follow the style guide

Related issue: rust-lang#159751

Rewords the `.expect(...)` messages in the `TcpStream`/`TcpListener` doc examples in `library/std/src/net/tcp.rs` to follow the "expect as precondition" style guide introduced in rust-lang#96033.

Examples of the change:
- `"set_nodelay call failed"` → `"set_nodelay should succeed"`
- `"could not set TTL"` → `"set_ttl should succeed"`
- `"Cannot set non-blocking"` → `"set_nonblocking should succeed"`

19 doc-example messages updated, all in doc comments (`///`). Doc-only change, no behavior change.
rust-bors Bot pushed a commit that referenced this pull request Aug 5, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #154585 (treat no_mangle_generic_items as hard error instead of lint warning)
 - #158147 (std: fix stack buffer overflow in Windows junction_point)
 - #160130 (Select cache values to verify by key fingerprint, not value fingerprint)
 - #160343 (Rename `OutlivesPredicate` to `OutlivesClause`)
 - #160360 (Remove rustc_middle dependency on rustc_hir_pretty)
 - #160387 (rustc_codegen_ssa: Correctly apply the static `--jobs-backend` limit to backend parallelism)
 - #160422 (move mir-opt miri tests to CI logic)
 - #160444 (Avoid resolving path keywords outside `TypeNS`)
 - #160510 (Resolver: (un)tracked borrows for `CmRefCell` made safe my unsafe speculative flag)
 - #155424 ([blocked] Link to proposed LLM policy in CONTRIBUTING and pull request template)
 - #158726 (std: move futex implementations into sys::sync::futex)
 - #158762 (Emit thumb code on VEX V5)
 - #159225 (Split IncrCompSession out of Session)
 - #159820 (Make the `rustc_unsafe_specialization_marker` attribute actually `unsafe`)
 - #160198 (Rework `smallest_range_containing` to handle duplicates)
 - #160362 (Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`)
 - #160390 (autodiff: Handle slice-tailed DSTs in type trees)
 - #160420 (Suggest `cast_signed()` for overflowing signed integer literals)
 - #160516 (Add regression test for HRTB projection in closure)
 - #160520 (Add some tests for specialization)
 - #160522 (fix(bootstrap): Normalize the names of proc macro dependency crates)
 - #160523 (Add regression test for opaque type)
 - #160531 (docs: fix typo in AllowExprMetavar comment)
 - #160538 (Update expect messages in tcp.rs doc examples to follow the style guide)
 - #160548 (bootstrap: Register `coverage-map` and `coverage-run` aliases via a separate step)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 5, 2026
…tyle, r=jhpratt

Update expect messages in tcp.rs doc examples to follow the style guide

Related issue: rust-lang#159751

Rewords the `.expect(...)` messages in the `TcpStream`/`TcpListener` doc examples in `library/std/src/net/tcp.rs` to follow the "expect as precondition" style guide introduced in rust-lang#96033.

Examples of the change:
- `"set_nodelay call failed"` → `"set_nodelay should succeed"`
- `"could not set TTL"` → `"set_ttl should succeed"`
- `"Cannot set non-blocking"` → `"set_nonblocking should succeed"`

19 doc-example messages updated, all in doc comments (`///`). Doc-only change, no behavior change.
rust-bors Bot pushed a commit that referenced this pull request Aug 5, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #158147 (std: fix stack buffer overflow in Windows junction_point)
 - #160130 (Select cache values to verify by key fingerprint, not value fingerprint)
 - #160343 (Rename `OutlivesPredicate` to `OutlivesClause`)
 - #160360 (Remove rustc_middle dependency on rustc_hir_pretty)
 - #160387 (rustc_codegen_ssa: Correctly apply the static `--jobs-backend` limit to backend parallelism)
 - #160422 (move mir-opt miri tests to CI logic)
 - #160444 (Avoid resolving path keywords outside `TypeNS`)
 - #160510 (Resolver: (un)tracked borrows for `CmRefCell` made safe by unsafe speculative flag)
 - #155424 ([blocked] Link to proposed LLM policy in CONTRIBUTING and pull request template)
 - #158726 (std: move futex implementations into sys::sync::futex)
 - #158762 (Emit thumb code on VEX V5)
 - #159225 (Split IncrCompSession out of Session)
 - #159820 (Make the `rustc_unsafe_specialization_marker` attribute actually `unsafe`)
 - #160198 (Rework `smallest_range_containing` to handle duplicates)
 - #160362 (Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`)
 - #160390 (autodiff: Handle slice-tailed DSTs in type trees)
 - #160420 (Suggest `cast_signed()` for overflowing signed integer literals)
 - #160501 (Add bootstrap CLI snapshot test for testing miri)
 - #160516 (Add regression test for HRTB projection in closure)
 - #160520 (Add some tests for specialization)
 - #160522 (fix(bootstrap): Normalize the names of proc macro dependency crates)
 - #160523 (Add regression test for opaque type)
 - #160531 (docs: fix typo in AllowExprMetavar comment)
 - #160538 (Update expect messages in tcp.rs doc examples to follow the style guide)
 - #160548 (bootstrap: Register `coverage-map` and `coverage-run` aliases via a separate step)
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