From c18e7b765f419abc1ba6c68ac655bd5dbd754e62 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 26 Apr 2023 21:06:22 +0000 Subject: [PATCH] IntoFuture::into_future is no longer unstable --- compiler/rustc_ast_lowering/src/expr.rs | 7 +------ compiler/rustc_ast_lowering/src/item.rs | 1 - compiler/rustc_ast_lowering/src/lib.rs | 1 - .../async_await.b-{closure#0}.generator_resume.0.mir | 2 +- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index 6863100d9ba..7a0a7da9695 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -858,13 +858,8 @@ fn lower_expr_await(&mut self, dot_await_span: Span, expr: &Expr) -> hir::ExprKi let awaitee_arm = self.arm(awaitee_pat, loop_expr); // `match ::std::future::IntoFuture::into_future() { ... }` - let into_future_span = self.mark_span_with_reason( - DesugaringKind::Await, - dot_await_span, - self.allow_into_future.clone(), - ); let into_future_expr = self.expr_call_lang_item_fn( - into_future_span, + span, hir::LangItem::IntoFutureIntoFuture, arena_vec![self; expr], Some(expr_hir_id), diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index a9fd8db281b..3d154a93fb2 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -83,7 +83,6 @@ fn with_lctx( impl_trait_bounds: Vec::new(), allow_try_trait: Some([sym::try_trait_v2, sym::yeet_desugar_details][..].into()), allow_gen_future: Some([sym::gen_future, sym::closure_track_caller][..].into()), - allow_into_future: Some([sym::into_future][..].into()), generics_def_id_map: Default::default(), }; lctx.with_hir_id_owner(owner, |lctx| f(lctx)); diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index d07355a4154..b5b28bf8e31 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -136,7 +136,6 @@ struct LoweringContext<'a, 'hir> { allow_try_trait: Option>, allow_gen_future: Option>, - allow_into_future: Option>, /// Mapping from generics `def_id`s to TAIT generics `def_id`s. /// For each captured lifetime (e.g., 'a), we create a new lifetime parameter that is a generic diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir index 7cce3415fa1..9bced25a595 100644 --- a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir +++ b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir @@ -12,7 +12,7 @@ _1: GeneratorSavedTy { ty: impl std::future::Future, source_info: SourceInfo { - span: $DIR/async_await.rs:16:8: 16:14 (#11), + span: $DIR/async_await.rs:16:8: 16:14 (#10), scope: scope[0], }, ignore_for_traits: false,