Simplify closure_env_ty and closure_env_param

This commit is contained in:
Michael Goulet 2024-01-14 18:29:01 +00:00
parent 5876c8cdfd
commit 6f98a6cc80
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(