Skip to content

Commit cba7f1a

Browse files
committed
Add Future and IntoFuture to the 2024 prelude
Implements RFC 3509.
1 parent 8a49772 commit cba7f1a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

library/core/src/prelude/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,8 @@ pub mod rust_2024 {
5454
#[unstable(feature = "prelude_2024", issue = "none")]
5555
#[doc(no_inline)]
5656
pub use super::rust_2021::*;
57+
58+
#[unstable(feature = "prelude_2024", issue = "none")]
59+
#[doc(no_inline)]
60+
pub use crate::future::{Future, IntoFuture};
5761
}

src/tools/tidy/src/ui_tests.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ 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+
20+
const ROOT_ENTRY_LIMIT: usize = 872;
2021

2122
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2223
"rs", // test source files

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)