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:
commit
46f6b05eb7
17 changed files with 66 additions and 78 deletions
|
@ -291,9 +291,9 @@ pub fn dtorck_constraint_for_ty_inner<'tcx>(
|
|||
return Err(NoSolution);
|
||||
}
|
||||
|
||||
constraints.outlives.extend(
|
||||
args.as_generator().upvar_tys().map(|t| -> ty::GenericArg<'tcx> { t.into() }),
|
||||
);
|
||||
constraints
|
||||
.outlives
|
||||
.extend(args.as_generator().upvar_tys().iter().map(ty::GenericArg::from));
|
||||
constraints.outlives.push(args.as_generator().resume_ty().into());
|
||||
}
|
||||
|
||||
|
|
|
@ -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()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue