@@ -58,7 +58,7 @@ macro_rules! document_select_macro {
58
58
/// select! {
59
59
/// x = st.next() => assert_eq!(Some(2), x),
60
60
/// _ = fut => panic!(),
61
- /// };
61
+ /// }
62
62
/// # });
63
63
/// ```
64
64
///
@@ -87,14 +87,15 @@ macro_rules! document_select_macro {
87
87
/// If a similar async function is called outside of `select` to produce
88
88
/// a `Future`, the `Future` must be pinned in order to be able to pass
89
89
/// it to `select`. This can be achieved via `Box::pin` for pinning a
90
- /// `Future` on the heap or the `pin_mut !` macro for pinning a `Future`
90
+ /// `Future` on the heap or the `pin !` macro for pinning a `Future`
91
91
/// on the stack.
92
92
///
93
93
/// ```
94
94
/// # futures::executor::block_on(async {
95
+ /// use core::pin::pin;
96
+ ///
95
97
/// use futures::future::FutureExt;
96
98
/// use futures::select;
97
- /// use futures::pin_mut;
98
99
///
99
100
/// // Calling the following async fn returns a Future which does not
100
101
/// // implement Unpin
@@ -105,7 +106,7 @@ macro_rules! document_select_macro {
105
106
/// let fut_1 = async_identity_fn(1).fuse();
106
107
/// let fut_2 = async_identity_fn(2).fuse();
107
108
/// let mut fut_1 = Box::pin(fut_1); // Pins the Future on the heap
108
- /// pin_mut !(fut_2); // Pins the Future on the stack
109
+ /// let mut fut_2 = pin !(fut_2); // Pins the Future on the stack
109
110
///
110
111
/// let res = select! {
111
112
/// a_res = fut_1 => a_res,
@@ -138,7 +139,7 @@ macro_rules! document_select_macro {
138
139
/// b = b_fut => total += b,
139
140
/// complete => break,
140
141
/// default => panic!(), // never runs (futures run first, then complete)
141
- /// };
142
+ /// }
142
143
/// }
143
144
/// assert_eq!(total, 10);
144
145
/// # });
@@ -209,7 +210,7 @@ macro_rules! document_select_macro {
209
210
/// select_biased! {
210
211
/// x = st.next() => assert_eq!(Some(2), x),
211
212
/// _ = fut => panic!(),
212
- /// };
213
+ /// }
213
214
/// # });
214
215
/// ```
215
216
///
@@ -238,14 +239,15 @@ macro_rules! document_select_macro {
238
239
/// If a similar async function is called outside of `select_biased` to produce
239
240
/// a `Future`, the `Future` must be pinned in order to be able to pass
240
241
/// it to `select_biased`. This can be achieved via `Box::pin` for pinning a
241
- /// `Future` on the heap or the `pin_mut !` macro for pinning a `Future`
242
+ /// `Future` on the heap or the `pin !` macro for pinning a `Future`
242
243
/// on the stack.
243
244
///
244
245
/// ```
245
246
/// # futures::executor::block_on(async {
247
+ /// use core::pin::pin;
248
+ ///
246
249
/// use futures::future::FutureExt;
247
250
/// use futures::select_biased;
248
- /// use futures::pin_mut;
249
251
///
250
252
/// // Calling the following async fn returns a Future which does not
251
253
/// // implement Unpin
@@ -256,7 +258,7 @@ macro_rules! document_select_macro {
256
258
/// let fut_1 = async_identity_fn(1).fuse();
257
259
/// let fut_2 = async_identity_fn(2).fuse();
258
260
/// let mut fut_1 = Box::pin(fut_1); // Pins the Future on the heap
259
- /// pin_mut !(fut_2); // Pins the Future on the stack
261
+ /// let mut fut_2 = pin !(fut_2); // Pins the Future on the stack
260
262
///
261
263
/// let res = select_biased! {
262
264
/// a_res = fut_1 => a_res,
@@ -289,7 +291,7 @@ macro_rules! document_select_macro {
289
291
/// b = b_fut => total += b,
290
292
/// complete => break,
291
293
/// default => panic!(), // never runs (futures run first, then complete)
292
- /// };
294
+ /// }
293
295
/// }
294
296
/// assert_eq!(total, 10);
295
297
/// # });
0 commit comments