From 2e1896e1976828e7ae0e7d10d8655fa40d50aa8a Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 29 May 2024 14:06:39 -0400 Subject: [PATCH 1/3] Add lang items for AsyncFn's associated types --- core/src/ops/async_function.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/ops/async_function.rs b/core/src/ops/async_function.rs index 18bcee5a1c7e0..fc21ffd5246ed 100644 --- a/core/src/ops/async_function.rs +++ b/core/src/ops/async_function.rs @@ -26,6 +26,7 @@ pub trait AsyncFn: AsyncFnMut { pub trait AsyncFnMut: AsyncFnOnce { /// Future returned by [`AsyncFnMut::async_call_mut`] and [`AsyncFn::async_call`]. #[unstable(feature = "async_fn_traits", issue = "none")] + #[cfg_attr(not(bootstrap), lang = "call_ref_future")] type CallRefFuture<'a>: Future where Self: 'a; @@ -46,10 +47,12 @@ pub trait AsyncFnMut: AsyncFnOnce { pub trait AsyncFnOnce { /// Future returned by [`AsyncFnOnce::async_call_once`]. #[unstable(feature = "async_fn_traits", issue = "none")] + #[cfg_attr(not(bootstrap), lang = "call_once_future")] type CallOnceFuture: Future; /// Output type of the called closure's future. #[unstable(feature = "async_fn_traits", issue = "none")] + #[cfg_attr(not(bootstrap), lang = "async_fn_once_output")] type Output; /// Call the [`AsyncFnOnce`], returning a future which may move out of the called closure. From a8f468f97f87d410945e6db88df04448bed9330e Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 29 May 2024 14:22:56 -0400 Subject: [PATCH 2/3] Add lang item for Future::Output --- core/src/future/future.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/future/future.rs b/core/src/future/future.rs index f965afc8a5937..86963b548b9c6 100644 --- a/core/src/future/future.rs +++ b/core/src/future/future.rs @@ -35,7 +35,7 @@ use crate::task::{Context, Poll}; pub trait Future { /// The type of value produced on completion. #[stable(feature = "futures_api", since = "1.36.0")] - #[rustc_diagnostic_item = "FutureOutput"] + #[cfg_attr(not(bootstrap), lang = "future_output")] type Output; /// Attempt to resolve the future to a final value, registering From 99eabb47fb4f8c66aefac9e99df5b558ff826521 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 29 May 2024 14:28:53 -0400 Subject: [PATCH 3/3] Add lang item for AsyncFnKindHelper::Upvars --- core/src/ops/async_function.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/ops/async_function.rs b/core/src/ops/async_function.rs index fc21ffd5246ed..f4e9d1a63ac67 100644 --- a/core/src/ops/async_function.rs +++ b/core/src/ops/async_function.rs @@ -146,6 +146,7 @@ mod internal_implementation_detail { // `for<'env> fn() -> (&'env T, ...)`. This allows us to represent the binder // of the closure's self-capture, and these upvar types will be instantiated with // the `'closure_env` region provided to the associated type. + #[cfg_attr(not(bootstrap), lang = "async_fn_kind_upvars")] type Upvars<'closure_env, Inputs, Upvars, BorrowedUpvarsAsFnPtr>; } }