1
Fork 0

change usages of type_of to bound_type_of

This commit is contained in:
Kyle Matsuda 2023-02-06 17:48:12 -07:00
parent 9a7cc6c32f
commit d822b97a27
136 changed files with 385 additions and 262 deletions

View file

@ -643,7 +643,7 @@ fn construct_error(
let num_params = match body_owner_kind {
hir::BodyOwnerKind::Fn => tcx.fn_sig(def).skip_binder().inputs().skip_binder().len(),
hir::BodyOwnerKind::Closure => {
let ty = tcx.type_of(def);
let ty = tcx.bound_type_of(def).subst_identity();
match ty.kind() {
ty::Closure(_, substs) => {
1 + substs.as_closure().sig().inputs().skip_binder().len()