File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1247,6 +1247,34 @@ impl<T> Receiver<T> {
12471247 /// [`SyncSender`]: struct.SyncSender.html
12481248 /// [`Err`]: ../../../std/result/enum.Result.html#variant.Err
12491249 ///
1250+ /// # Known Issues
1251+ ///
1252+ /// There is currently a known issue (see [`#39364`]) that causes `recv_timeout`
1253+ /// to panic unexpectedly with the following example:
1254+ ///
1255+ /// ```no_run
1256+ /// use std::sync::mpsc::channel;
1257+ /// use std::thread;
1258+ /// use std::time::Duration;
1259+ ///
1260+ /// let (tx, rx) = channel::<String>();
1261+ ///
1262+ /// thread::spawn(move || {
1263+ /// let d = Duration::from_millis(10);
1264+ /// loop {
1265+ /// println!("recv");
1266+ /// let _r = rx.recv_timeout(d);
1267+ /// }
1268+ /// });
1269+ ///
1270+ /// thread::sleep(Duration::from_millis(100));
1271+ /// let _c1 = tx.clone();
1272+ ///
1273+ /// thread::sleep(Duration::from_secs(1));
1274+ /// ```
1275+ ///
1276+ /// [`#39364`]: https://github.com/rust-lang/rust/issues/39364
1277+ ///
12501278 /// # Examples
12511279 ///
12521280 /// Successfully receiving value before encountering timeout:
You can’t perform that action at this time.
0 commit comments