mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Rollup merge of #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 #122267.
This commit is contained in:
commit
c89a6cd0ad
@ -951,18 +951,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
});
|
||||
|
||||
// We must additionally check that the return type impls `Future`.
|
||||
|
||||
// FIXME(async_closures): Investigate this before stabilization.
|
||||
// We instantiate this binder eagerly because the `confirm_future_candidate`
|
||||
// method doesn't support higher-ranked futures, which the `AsyncFn`
|
||||
// traits expressly allow the user to write. To fix this correctly,
|
||||
// we'd need to instantiate trait bounds before we get to selection,
|
||||
// like the new trait solver does.
|
||||
let future_trait_def_id = tcx.require_lang_item(LangItem::Future, None);
|
||||
let placeholder_output_ty = self.infcx.enter_forall_and_leak_universe(sig.output());
|
||||
nested.push(obligation.with(
|
||||
tcx,
|
||||
ty::TraitRef::new(tcx, future_trait_def_id, [placeholder_output_ty]),
|
||||
sig.output().map_bound(|output_ty| {
|
||||
ty::TraitRef::new(tcx, future_trait_def_id, [output_ty])
|
||||
}),
|
||||
));
|
||||
|
||||
(trait_ref, Ty::from_closure_kind(tcx, ty::ClosureKind::Fn))
|
||||
|
Loading…
Reference in New Issue
Block a user