1
Fork 0

Rollup merge of #119969 - compiler-errors:simplify-closure-env-ty, r=oli-obk

Simplify `closure_env_ty` and `closure_env_param`

Random cleanup that I found when working on async closures. This makes it easier to separate the latter into a new tykind.
This commit is contained in:
Matthias Krüger 2024-01-16 17:55:23 +01:00 committed by GitHub
commit 4735171667
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 54 deletions

View file

@ -83,7 +83,11 @@ fn fn_sig_for_fn_abi<'tcx>(
kind: ty::BoundRegionKind::BrEnv,
};
let env_region = ty::Region::new_bound(tcx, ty::INNERMOST, br);
let env_ty = tcx.closure_env_ty(def_id, args, env_region).unwrap();
let env_ty = tcx.closure_env_ty(
Ty::new_closure(tcx, def_id, args),
args.as_closure().kind(),
env_region,
);
let sig = sig.skip_binder();
ty::Binder::bind_with_vars(