From 48dfbeee27e748a598681d24bd8b69f5ea611f85 Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Sun, 7 May 2023 10:52:01 +0200 Subject: [PATCH] Remove `identity_future` from stdlib This function/lang_item was introduced in #104321 as a temporary workaround of future lowering. The usage and need for it went away in #104833. After a bootstrap update, the function itself can be removed from `std`. --- library/core/src/future/mod.rs | 7 ------- src/tools/rust-analyzer/crates/hir-def/src/lang_item.rs | 1 - 2 files changed, 8 deletions(-) diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs index 7a8d0cacdec..089493d3766 100644 --- a/library/core/src/future/mod.rs +++ b/library/core/src/future/mod.rs @@ -66,10 +66,3 @@ pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> { // that fulfills all the requirements for a mutable reference. unsafe { &mut *cx.0.as_ptr().cast() } } - -#[doc(hidden)] -#[unstable(feature = "gen_future", issue = "50547")] -#[inline] -pub const fn identity_future>(f: Fut) -> Fut { - f -} diff --git a/src/tools/rust-analyzer/crates/hir-def/src/lang_item.rs b/src/tools/rust-analyzer/crates/hir-def/src/lang_item.rs index 4096e0a3826..d338bb41205 100644 --- a/src/tools/rust-analyzer/crates/hir-def/src/lang_item.rs +++ b/src/tools/rust-analyzer/crates/hir-def/src/lang_item.rs @@ -379,7 +379,6 @@ language_item_table! { // FIXME(swatinem): the following lang items are used for async lowering and // should become obsolete eventually. ResumeTy, ResumeTy, resume_ty, Target::Struct, GenericRequirement::None; - IdentityFuture, identity_future, identity_future_fn, Target::Fn, GenericRequirement::None; GetContext, get_context, get_context_fn, Target::Fn, GenericRequirement::None; Context, Context, context, Target::Struct, GenericRequirement::None;