Skip to content

UdpSocket: document recv/recv_from differences#154266

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
nia-e:udp-socket-docs
Apr 1, 2026
Merged

UdpSocket: document recv/recv_from differences#154266
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
nia-e:udp-socket-docs

Conversation

@nia-e
Copy link
Copy Markdown
Member

@nia-e nia-e commented Mar 23, 2026

Per libs-api consensus, fixes #149392 by documenting possible platform-specific behavior in UdpSocket.

r? libs

@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 Mar 23, 2026
Copy link
Copy Markdown
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

r=me with nit applied or if you don't feel its warranted (people can guess based on the name) we can leave it to a future PR

View changes since this review

///
/// Refer to the platform-specific documentation on this function; it is considered
/// correct for its behavior to differ from [`UdpSocket::recv`] if the underlying system
/// call does so.
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.

This sounds fine, but we don't tell people what this does under the hood, so I'm not sure they can refer to platform-specific documentation easily. Maybe we can add a section on what the underlying libc/syscall made is (with a link to https://doc.rust-lang.org/nightly/std/io/index.html#platform-specific-behavior)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Discussed this in the libs-api meeting; we intentionally don't guarantee this right now, but most platforms have an "obvious" choice (e.g. recvfrom on linux)

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 27, 2026
@nia-e
Copy link
Copy Markdown
Member Author

nia-e commented Mar 31, 2026

@bors r=Mark-Simulacrum rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 31, 2026

📌 Commit d873e1f has been approved by Mark-Simulacrum

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 31, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 31, 2026
…uwer

Rollup of 2 pull requests

Successful merges:

 - #154249 (Mention on which items the `missing_doc_code_examples` is not emitted)
 - #154266 (UdpSocket: document `recv/recv_from` differences)
@rust-bors rust-bors bot merged commit 807b9ae into rust-lang:main Apr 1, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Apr 1, 2026
Rollup merge of #154266 - nia-e:udp-socket-docs, r=Mark-Simulacrum

UdpSocket: document `recv/recv_from` differences

Per libs-api consensus, fixes #149392 by documenting possible platform-specific behavior in `UdpSocket`.

r? libs
@rustbot rustbot added this to the 1.96.0 milestone Apr 1, 2026
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.

UdpSocket: recv() and recv_from() behave differently for zero sized buffers

3 participants