Rollup merge of #114079 - compiler-errors:closure-upvars, r=oli-obk
Use `upvar_tys` in more places, make it return a list Just a cleanup that fell out of a PR that I was gonna write, but that PR kinda got stuck.
This commit is contained in:
@@ -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()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user