diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2024-02-13 18:35:17 +0100 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2024-02-18 23:20:05 +0100 |
| commit | bd8a1a417ad778574c06875639b23699e9501a85 (patch) | |
| tree | 8636ea1b0909262428f39e39709859c9c5ff0393 | |
| parent | 8a497723e311a62fccb1f0bf40e79c6519744a12 (diff) | |
| download | rust-bd8a1a417ad778574c06875639b23699e9501a85.tar.gz rust-bd8a1a417ad778574c06875639b23699e9501a85.zip | |
Add `Future` and `IntoFuture` to the 2024 prelude
Implements RFC 3509.
| -rw-r--r-- | library/core/src/prelude/mod.rs | 8 | ||||
| -rw-r--r-- | library/std/src/prelude/mod.rs | 6 | ||||
| -rw-r--r-- | src/tools/tidy/src/ui_tests.rs | 2 | ||||
| -rw-r--r-- | tests/ui/async-await/for-await-passthrough.rs | 2 | ||||
| -rw-r--r-- | tests/ui/coroutine/async_gen_fn_iter.rs | 1 | ||||
| -rw-r--r-- | tests/ui/rust-2024/prelude2024.rs | 9 |
6 files changed, 19 insertions, 9 deletions
diff --git a/library/core/src/prelude/mod.rs b/library/core/src/prelude/mod.rs index 12f762ef193..b4791c2c022 100644 --- a/library/core/src/prelude/mod.rs +++ b/library/core/src/prelude/mod.rs @@ -49,9 +49,13 @@ pub mod rust_2021 { /// The 2024 edition of the core prelude. /// /// See the [module-level documentation](self) for more. -#[unstable(feature = "prelude_2024", issue = "none")] +#[unstable(feature = "prelude_2024", issue = "121042")] pub mod rust_2024 { - #[unstable(feature = "prelude_2024", issue = "none")] + #[unstable(feature = "prelude_2024", issue = "121042")] #[doc(no_inline)] pub use super::rust_2021::*; + + #[unstable(feature = "prelude_2024", issue = "121042")] + #[doc(no_inline)] + pub use crate::future::{Future, IntoFuture}; } diff --git a/library/std/src/prelude/mod.rs b/library/std/src/prelude/mod.rs index 1b29c887d21..7d44d2e4b5d 100644 --- a/library/std/src/prelude/mod.rs +++ b/library/std/src/prelude/mod.rs @@ -132,13 +132,13 @@ pub mod rust_2021 { /// The 2024 version of the prelude of The Rust Standard Library. /// /// See the [module-level documentation](self) for more. -#[unstable(feature = "prelude_2024", issue = "none")] +#[unstable(feature = "prelude_2024", issue = "121042")] pub mod rust_2024 { - #[unstable(feature = "prelude_2024", issue = "none")] + #[unstable(feature = "prelude_2024", issue = "121042")] #[doc(no_inline)] pub use super::v1::*; - #[unstable(feature = "prelude_2024", issue = "none")] + #[unstable(feature = "prelude_2024", issue = "121042")] #[doc(no_inline)] pub use core::prelude::rust_2024::*; } diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 5517b9fdcec..d0e4874f304 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -16,7 +16,7 @@ const ENTRY_LIMIT: usize = 900; // FIXME: The following limits should be reduced eventually. const ISSUES_ENTRY_LIMIT: usize = 1781; -const ROOT_ENTRY_LIMIT: usize = 871; +const ROOT_ENTRY_LIMIT: usize = 872; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files diff --git a/tests/ui/async-await/for-await-passthrough.rs b/tests/ui/async-await/for-await-passthrough.rs index 3769ef60b01..e09e843332e 100644 --- a/tests/ui/async-await/for-await-passthrough.rs +++ b/tests/ui/async-await/for-await-passthrough.rs @@ -4,8 +4,6 @@ #![feature(async_iterator, async_iter_from_iter, const_waker, async_for_loop, noop_waker, gen_blocks)] -use std::future::Future; - async gen fn async_iter() -> i32 { let iter = core::async_iter::from_iter(0..3); for await i in iter { diff --git a/tests/ui/coroutine/async_gen_fn_iter.rs b/tests/ui/coroutine/async_gen_fn_iter.rs index c4a7629f314..42288712c70 100644 --- a/tests/ui/coroutine/async_gen_fn_iter.rs +++ b/tests/ui/coroutine/async_gen_fn_iter.rs @@ -46,7 +46,6 @@ async fn async_main() { use std::pin::{Pin, pin}; use std::task::*; use std::async_iter::AsyncIterator; -use std::future::Future; trait AsyncIterExt { fn next(&mut self) -> Next<'_, Self>; diff --git a/tests/ui/rust-2024/prelude2024.rs b/tests/ui/rust-2024/prelude2024.rs new file mode 100644 index 00000000000..e58ebe74188 --- /dev/null +++ b/tests/ui/rust-2024/prelude2024.rs @@ -0,0 +1,9 @@ +//@ check-pass +//@ compile-flags: -Zunstable-options +//@ edition:2024 + +fn main() { + fut(async {}.into_future(), async {}); +} + +fn fut(_: impl Future, _: impl IntoFuture) {} |
