Skip to content

Commit cf0b36a

Browse files
authored
Rollup merge of rust-lang#121041 - Nilstrieb:into-the-future-of-2024, r=Mark-Simulacrum
Add `Future` and `IntoFuture` to the 2024 prelude Implements rust-lang/rfcs#3509.
2 parents 25bba60 + bd8a1a4 commit cf0b36a

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

library/core/src/prelude/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ pub mod rust_2021 {
4949
/// The 2024 edition of the core prelude.
5050
///
5151
/// See the [module-level documentation](self) for more.
52-
#[unstable(feature = "prelude_2024", issue = "none")]
52+
#[unstable(feature = "prelude_2024", issue = "121042")]
5353
pub mod rust_2024 {
54-
#[unstable(feature = "prelude_2024", issue = "none")]
54+
#[unstable(feature = "prelude_2024", issue = "121042")]
5555
#[doc(no_inline)]
5656
pub use super::rust_2021::*;
57+
58+
#[unstable(feature = "prelude_2024", issue = "121042")]
59+
#[doc(no_inline)]
60+
pub use crate::future::{Future, IntoFuture};
5761
}

library/std/src/prelude/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ pub mod rust_2021 {
132132
/// The 2024 version of the prelude of The Rust Standard Library.
133133
///
134134
/// See the [module-level documentation](self) for more.
135-
#[unstable(feature = "prelude_2024", issue = "none")]
135+
#[unstable(feature = "prelude_2024", issue = "121042")]
136136
pub mod rust_2024 {
137-
#[unstable(feature = "prelude_2024", issue = "none")]
137+
#[unstable(feature = "prelude_2024", issue = "121042")]
138138
#[doc(no_inline)]
139139
pub use super::v1::*;
140140

141-
#[unstable(feature = "prelude_2024", issue = "none")]
141+
#[unstable(feature = "prelude_2024", issue = "121042")]
142142
#[doc(no_inline)]
143143
pub use core::prelude::rust_2024::*;
144144
}

src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const ENTRY_LIMIT: usize = 900;
1616
// FIXME: The following limits should be reduced eventually.
1717

1818
const ISSUES_ENTRY_LIMIT: usize = 1781;
19-
const ROOT_ENTRY_LIMIT: usize = 871;
19+
const ROOT_ENTRY_LIMIT: usize = 872;
2020

2121
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2222
"rs", // test source files

tests/ui/async-await/for-await-passthrough.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#![feature(async_iterator, async_iter_from_iter, const_waker, async_for_loop, noop_waker,
55
gen_blocks)]
66

7-
use std::future::Future;
8-
97
async gen fn async_iter() -> i32 {
108
let iter = core::async_iter::from_iter(0..3);
119
for await i in iter {

tests/ui/coroutine/async_gen_fn_iter.rs

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ async fn async_main() {
4646
use std::pin::{Pin, pin};
4747
use std::task::*;
4848
use std::async_iter::AsyncIterator;
49-
use std::future::Future;
5049

5150
trait AsyncIterExt {
5251
fn next(&mut self) -> Next<'_, Self>;

tests/ui/rust-2024/prelude2024.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ check-pass
2+
//@ compile-flags: -Zunstable-options
3+
//@ edition:2024
4+
5+
fn main() {
6+
fut(async {}.into_future(), async {});
7+
}
8+
9+
fn fut(_: impl Future, _: impl IntoFuture) {}

0 commit comments

Comments
 (0)