Streamline some inputs/output traversals.
This commit is contained in:
parent
b9f3db6adb
commit
bbd1c3ab73
@ -251,8 +251,7 @@ fn add_kind(&mut self, kind: &ty::TyKind<'_>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&ty::FnPtr(sig_tys, _) => self.bound_computation(sig_tys, |computation, sig_tys| {
|
&ty::FnPtr(sig_tys, _) => self.bound_computation(sig_tys, |computation, sig_tys| {
|
||||||
computation.add_tys(sig_tys.inputs());
|
computation.add_tys(sig_tys.inputs_and_output);
|
||||||
computation.add_ty(sig_tys.output());
|
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,11 +189,9 @@ fn push_inner<'tcx>(stack: &mut TypeWalkerStack<'tcx>, parent: GenericArg<'tcx>)
|
|||||||
stack.extend(args.iter().rev());
|
stack.extend(args.iter().rev());
|
||||||
}
|
}
|
||||||
ty::Tuple(ts) => stack.extend(ts.iter().rev().map(GenericArg::from)),
|
ty::Tuple(ts) => stack.extend(ts.iter().rev().map(GenericArg::from)),
|
||||||
ty::FnPtr(sig_tys, hdr) => {
|
ty::FnPtr(sig_tys, _hdr) => {
|
||||||
let fn_sig = sig_tys.with(hdr);
|
|
||||||
stack.push(fn_sig.skip_binder().output().into());
|
|
||||||
stack.extend(
|
stack.extend(
|
||||||
fn_sig.skip_binder().inputs().iter().copied().rev().map(|ty| ty.into()),
|
sig_tys.skip_binder().inputs_and_output.iter().rev().map(|ty| ty.into()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user