From d873e1f49cee7afc220dbb2c9b34d6bbdc941e05 Mon Sep 17 00:00:00 2001 From: Nia Espera Date: Mon, 23 Mar 2026 17:52:44 +0100 Subject: [PATCH 1/2] UdpSocket: document `recv/recv_from` differences --- library/std/src/net/udp.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/std/src/net/udp.rs b/library/std/src/net/udp.rs index 136803ab16f1f..5da6b38037f0e 100644 --- a/library/std/src/net/udp.rs +++ b/library/std/src/net/udp.rs @@ -129,6 +129,10 @@ impl UdpSocket { /// hold the message bytes. If a message is too long to fit in the supplied buffer, /// excess bytes may be discarded. /// + /// 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. + /// /// # Examples /// /// ```no_run @@ -711,6 +715,10 @@ impl UdpSocket { /// [`UdpSocket::connect`] will connect this socket to a remote address. This /// method will fail if the socket is not connected. /// + /// Refer to the platform-specific documentation on this function; it is considered + /// correct for its behavior to differ from [`UdpSocket::recv_from`] if the underlying + /// system call does so. + /// /// # Examples /// /// ```no_run From f8a8b8f739db2151272bc8577686e8fe06956cbb Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 23 Mar 2026 11:34:17 +0100 Subject: [PATCH 2/2] Mention on which items the `missing_doc_code_examples` is not emitted --- src/doc/rustdoc/src/lints.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index c05077befdb3a..9dee33ef6eb85 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -190,6 +190,16 @@ To fix the lint, you need to add a code example into the documentation block: pub fn no_code_example() {} ``` +This lint is not emitted on the following items: + + * Impl blocks (both trait and inherent) + * Enum variants + * Struct/union fields + * Type aliases, including associated types + * Statics/constants + * Modules (including the top-level module of a crate) + * Foreign items from reexports (functions, statics, types, etc) + ## `private_doc_tests` This lint is **allowed by default**. It detects documentation tests when they