@@ -137,8 +137,12 @@ impl<T> UnboundedReceiver<T> {
137137 /// This method returns the [`Disconnected`] error if the channel is
138138 /// currently empty, and there are no outstanding [senders] or [permits].
139139 ///
140+ /// Unlike the [`poll_recv`] method, this method will never return an
141+ /// [`Empty`] error spuriously.
142+ ///
140143 /// [`Empty`]: crate::sync::mpsc::error::TryRecvError::Empty
141144 /// [`Disconnected`]: crate::sync::mpsc::error::TryRecvError::Disconnected
145+ /// [`poll_recv`]: Self::poll_recv
142146 /// [senders]: crate::sync::mpsc::Sender
143147 /// [permits]: crate::sync::mpsc::Permit
144148 ///
@@ -212,7 +216,7 @@ impl<T> UnboundedReceiver<T> {
212216 /// This method returns:
213217 ///
214218 /// * `Poll::Pending` if no messages are available but the channel is not
215- /// closed.
219+ /// closed, or if a spurious failure happens .
216220 /// * `Poll::Ready(Some(message))` if a message is available.
217221 /// * `Poll::Ready(None)` if the channel has been closed and all messages
218222 /// sent before it was closed have been received.
@@ -222,6 +226,12 @@ impl<T> UnboundedReceiver<T> {
222226 /// receiver, or when the channel is closed. Note that on multiple calls to
223227 /// `poll_recv`, only the `Waker` from the `Context` passed to the most
224228 /// recent call is scheduled to receive a wakeup.
229+ ///
230+ /// If this method returns `Poll::Pending` due to a spurious failure, then
231+ /// the `Waker` will be notified when the situation causing the spurious
232+ /// failure has been resolved. Note that receiving such a wakeup does not
233+ /// guarantee that the next call will succeed — it could fail with another
234+ /// spurious failure.
225235 pub fn poll_recv ( & mut self , cx : & mut Context < ' _ > ) -> Poll < Option < T > > {
226236 self . chan . recv ( cx)
227237 }
0 commit comments