Skip to content

Commit 563eb04

Browse files
authored
Rollup merge of #110864 - compiler-errors:into-future-stable, r=jackh726
`IntoFuture::into_future` is no longer unstable We don't need to gate the `IntoFuture::into_future` call in `.await` lowering anymore. ``@bors`` rollup
2 parents 63fbb05 + c18e7b7 commit 563eb04

File tree

4 files changed

+2
-9
lines changed

4 files changed

+2
-9
lines changed

compiler/rustc_ast_lowering/src/expr.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -858,13 +858,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
858858
let awaitee_arm = self.arm(awaitee_pat, loop_expr);
859859

860860
// `match ::std::future::IntoFuture::into_future(<expr>) { ... }`
861-
let into_future_span = self.mark_span_with_reason(
862-
DesugaringKind::Await,
863-
dot_await_span,
864-
self.allow_into_future.clone(),
865-
);
866861
let into_future_expr = self.expr_call_lang_item_fn(
867-
into_future_span,
862+
span,
868863
hir::LangItem::IntoFutureIntoFuture,
869864
arena_vec![self; expr],
870865
Some(expr_hir_id),

compiler/rustc_ast_lowering/src/item.rs

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ impl<'a, 'hir> ItemLowerer<'a, 'hir> {
8383
impl_trait_bounds: Vec::new(),
8484
allow_try_trait: Some([sym::try_trait_v2, sym::yeet_desugar_details][..].into()),
8585
allow_gen_future: Some([sym::gen_future, sym::closure_track_caller][..].into()),
86-
allow_into_future: Some([sym::into_future][..].into()),
8786
generics_def_id_map: Default::default(),
8887
};
8988
lctx.with_hir_id_owner(owner, |lctx| f(lctx));

compiler/rustc_ast_lowering/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ struct LoweringContext<'a, 'hir> {
136136

137137
allow_try_trait: Option<Lrc<[Symbol]>>,
138138
allow_gen_future: Option<Lrc<[Symbol]>>,
139-
allow_into_future: Option<Lrc<[Symbol]>>,
140139

141140
/// Mapping from generics `def_id`s to TAIT generics `def_id`s.
142141
/// For each captured lifetime (e.g., 'a), we create a new lifetime parameter that is a generic

tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
_1: GeneratorSavedTy {
1313
ty: impl std::future::Future<Output = ()>,
1414
source_info: SourceInfo {
15-
span: $DIR/async_await.rs:16:8: 16:14 (#11),
15+
span: $DIR/async_await.rs:16:8: 16:14 (#10),
1616
scope: scope[0],
1717
},
1818
ignore_for_traits: false,

0 commit comments

Comments
 (0)