Skip to content

Commit 4ba8bfe

Browse files
authored
Unrolled build for rust-lang#132486
Rollup merge of rust-lang#132486 - compiler-errors:no-binder, r=lcnr No need to instantiate binder in `confirm_async_closure_candidate` Removes a FIXME that is redundant. No longer needed since rust-lang#122267.
2 parents 432972c + c10fe34 commit 4ba8bfe

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -951,18 +951,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
951951
});
952952

953953
// We must additionally check that the return type impls `Future`.
954-
955-
// FIXME(async_closures): Investigate this before stabilization.
956-
// We instantiate this binder eagerly because the `confirm_future_candidate`
957-
// method doesn't support higher-ranked futures, which the `AsyncFn`
958-
// traits expressly allow the user to write. To fix this correctly,
959-
// we'd need to instantiate trait bounds before we get to selection,
960-
// like the new trait solver does.
961954
let future_trait_def_id = tcx.require_lang_item(LangItem::Future, None);
962-
let placeholder_output_ty = self.infcx.enter_forall_and_leak_universe(sig.output());
963955
nested.push(obligation.with(
964956
tcx,
965-
ty::TraitRef::new(tcx, future_trait_def_id, [placeholder_output_ty]),
957+
sig.output().map_bound(|output_ty| {
958+
ty::TraitRef::new(tcx, future_trait_def_id, [output_ty])
959+
}),
966960
));
967961

968962
(trait_ref, Ty::from_closure_kind(tcx, ty::ClosureKind::Fn))

0 commit comments

Comments
 (0)