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:
Nilstrieb 2023-08-02 13:46:54 +02:00 committed by GitHub
commit 46f6b05eb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 66 additions and 78 deletions

View file

@ -448,7 +448,9 @@ where
ty::Closure(_, ref args) => {
// Skip lifetime parameters of the enclosing item(s)
args.as_closure().tupled_upvars_ty().visit_with(self);
for upvar in args.as_closure().upvar_tys() {
upvar.visit_with(self);
}
args.as_closure().sig_as_fn_ptr_ty().visit_with(self);
}
@ -456,7 +458,9 @@ where
// Skip lifetime parameters of the enclosing item(s)
// Also skip the witness type, because that has no free regions.
args.as_generator().tupled_upvars_ty().visit_with(self);
for upvar in args.as_generator().upvar_tys() {
upvar.visit_with(self);
}
args.as_generator().return_ty().visit_with(self);
args.as_generator().yield_ty().visit_with(self);
args.as_generator().resume_ty().visit_with(self);