Use upvar_tys in more places, make it a list

This commit is contained in:
Michael Goulet 2023-07-25 23:31:21 +00:00
parent d12c6e947c
commit 99969d282b
17 changed files with 66 additions and 78 deletions

View file

@ -2169,7 +2169,8 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
let all = args
.as_generator()
.upvar_tys()
.chain(iter::once(args.as_generator().witness()))
.iter()
.chain([args.as_generator().witness()])
.collect::<Vec<_>>();
Where(obligation.predicate.rebind(all))
}
@ -2210,7 +2211,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
// Not yet resolved.
Ambiguous
} else {
Where(obligation.predicate.rebind(args.as_closure().upvar_tys().collect()))
Where(obligation.predicate.rebind(args.as_closure().upvar_tys().to_vec()))
}
}