@@ -454,10 +454,16 @@ impl<T> UnsafeFlavor<T> for Receiver<T> {
454
454
}
455
455
456
456
/// Creates a new asynchronous channel, returning the sender/receiver halves.
457
- ///
458
457
/// All data sent on the sender will become available on the receiver, and no
459
458
/// send will block the calling thread (this channel has an "infinite buffer").
460
459
///
460
+ /// If the [`Receiver`] is disconnected while trying to [`send()`] with the
461
+ /// [`Sender`], the [`send()`] method will return an error.
462
+ ///
463
+ /// [`send()`]: ../../../std/sync/mpsc/struct.Sender.html#method.send
464
+ /// [`Sender`]: ../../../std/sync/mpsc/struct.Sender.html
465
+ /// [`Receiver`]: ../../../std/sync/mpsc/struct.Receiver.html
466
+ ///
461
467
/// # Examples
462
468
///
463
469
/// ```
@@ -487,18 +493,23 @@ pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
487
493
488
494
/// Creates a new synchronous, bounded channel.
489
495
///
490
- /// Like asynchronous channels, the `Receiver` will block until a message
496
+ /// Like asynchronous channels, the [ `Receiver`] will block until a message
491
497
/// becomes available. These channels differ greatly in the semantics of the
492
498
/// sender from asynchronous channels, however.
493
499
///
494
- /// This channel has an internal buffer on which messages will be queued. `bound`
495
- /// specifies the buffer size. When the internal buffer becomes full, future sends
496
- /// will *block* waiting for the buffer to open up. Note that a buffer size of 0
497
- /// is valid, in which case this becomes "rendezvous channel" where each send will
498
- /// not return until a recv is paired with it.
500
+ /// This channel has an internal buffer on which messages will be queued.
501
+ /// `bound` specifies the buffer size. When the internal buffer becomes full,
502
+ /// future sends will *block* waiting for the buffer to open up. Note that a
503
+ /// buffer size of 0 is valid, in which case this becomes "rendezvous channel"
504
+ /// where each [`send()`] will not return until a recv is paired with it.
505
+ ///
506
+ /// Like asynchronous channels, if the [`Receiver`] is disconnected while
507
+ /// trying to [`send()`] with the [`SyncSender`], the [`send()`] method will
508
+ /// return an error.
499
509
///
500
- /// As with asynchronous channels, all senders will panic in `send` if the
501
- /// `Receiver` has been destroyed.
510
+ /// [`send()`]: ../../../std/sync/mpsc/struct.SyncSender.html#method.send
511
+ /// [`SyncSender`]: ../../../std/sync/mpsc/struct.SyncSender.html
512
+ /// [`Receiver`]: ../../../std/sync/mpsc/struct.Receiver.html
502
513
///
503
514
/// # Examples
504
515
///
0 commit comments