Rollup merge of #121617 - compiler-errors:async-closure-kind-check, r=oli-obk
Actually use the right closure kind when checking async Fn goals Dumb copy-paste mistake on my part from #120712. Sorry! r? oli-obk Fixes #121599
This commit is contained in:
commit
4f167b4baf
3 changed files with 33 additions and 7 deletions
|
@ -934,7 +934,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
(trait_ref, Ty::from_closure_kind(tcx, ty::ClosureKind::Fn))
|
||||
}
|
||||
ty::Closure(_, args) => {
|
||||
let sig = args.as_closure().sig();
|
||||
let args = args.as_closure();
|
||||
let sig = args.sig();
|
||||
let trait_ref = sig.map_bound(|sig| {
|
||||
ty::TraitRef::new(
|
||||
self.tcx(),
|
||||
|
@ -950,7 +951,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
ty::TraitRef::new(tcx, future_trait_def_id, [sig.output()])
|
||||
}),
|
||||
));
|
||||
(trait_ref, Ty::from_closure_kind(tcx, ty::ClosureKind::Fn))
|
||||
(trait_ref, args.kind_ty())
|
||||
}
|
||||
_ => bug!("expected callable type for AsyncFn candidate"),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue