Auto merge of #77873 - sexxi-goose:use_tuple_inference_for_closures, r=nikomatsakis
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. closes https://github.com/rust-lang/project-rfc-2229/issues/4 r? `@nikomatsakis`
This commit is contained in:
@@ -110,7 +110,7 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
// check if *any* of those are trivial.
|
||||
ty::Tuple(ref tys) => tys.iter().all(|t| trivial_dropck_outlives(tcx, t.expect_ty())),
|
||||
ty::Closure(_, ref substs) => {
|
||||
substs.as_closure().upvar_tys().all(|t| trivial_dropck_outlives(tcx, t))
|
||||
trivial_dropck_outlives(tcx, substs.as_closure().tupled_upvars_ty())
|
||||
}
|
||||
|
||||
ty::Adt(def, _) => {
|
||||
|
||||
Reference in New Issue
Block a user