Skip to content

Commit 6112cfd

Browse files
committed
Auto merge of rust-lang#132611 - compiler-errors:async-prelude, r=ibraheemdev
Add `AsyncFn*` to the prelude in all editions The general vibe is that we will most likely stabilize the `feature(async_closure)` *without* the `async Fn()` trait bound modifier. Without `async Fn()` bound syntax, this necessitates users to spell the bound like `AsyncFn()`. Since `core::ops::AsyncFn` is not in the prelude, users will need to import these any time they actually want to use the trait. This seems annoying, so let's add these traits to the prelude unstably. We're trying to work on the general vision of `async` trait bound modifier in general in: rust-lang/rfcs#3710, however that RFC still needs more time for consensus to converge, and we've decided that the value that users get from calling the bound `async Fn()` is *not really* worth blocking landing async closures in general.
2 parents 23a5a0e + 553bb18 commit 6112cfd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

std/src/prelude/common.rs

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pub use crate::marker::{Send, Sized, Sync, Unpin};
1212
#[stable(feature = "rust1", since = "1.0.0")]
1313
#[doc(no_inline)]
1414
pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
15+
#[unstable(feature = "async_closure", issue = "62290")]
16+
#[doc(no_inline)]
17+
pub use crate::ops::{AsyncFn, AsyncFnMut, AsyncFnOnce};
1518

1619
// Re-exported functions
1720
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)