Replace tuple of infer vars for upvar_tys with single infer var
This commit allows us to decide the number of captures required after completing capture ananysis, which is required as part of implementing RFC-2229. Co-authored-by: Aman Arora <me@aman-arora.com> Co-authored-by: Jenny Wills <wills.jenniferg@gmail.com>
This commit is contained in:
@@ -656,6 +656,14 @@ impl<'tcx> UpvarSubsts<'tcx> {
|
||||
};
|
||||
tupled_upvars_ty.expect_ty().tuple_fields()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn tupled_upvars_ty(self) -> Ty<'tcx> {
|
||||
match self {
|
||||
UpvarSubsts::Closure(substs) => substs.as_closure().tupled_upvars_ty(),
|
||||
UpvarSubsts::Generator(substs) => substs.as_generator().tupled_upvars_ty(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, TyEncodable, TyDecodable)]
|
||||
|
||||
Reference in New Issue
Block a user