Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Future and IntoFuture to the 2024 prelude #121041

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions library/core/src/prelude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
}
6 changes: 3 additions & 3 deletions library/std/src/prelude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
}
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/for-await-passthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion tests/ui/coroutine/async_gen_fn_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
9 changes: 9 additions & 0 deletions tests/ui/rust-2024/prelude2024.rs
Original file line number Diff line number Diff line change
@@ -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) {}
Loading