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| {
|
||||
computation.add_tys(sig_tys.inputs());
|
||||
computation.add_ty(sig_tys.output());
|
||||
computation.add_tys(sig_tys.inputs_and_output);
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
@ -189,11 +189,9 @@ fn push_inner<'tcx>(stack: &mut TypeWalkerStack<'tcx>, parent: GenericArg<'tcx>)
|
||||
stack.extend(args.iter().rev());
|
||||
}
|
||||
ty::Tuple(ts) => stack.extend(ts.iter().rev().map(GenericArg::from)),
|
||||
ty::FnPtr(sig_tys, hdr) => {
|
||||
let fn_sig = sig_tys.with(hdr);
|
||||
stack.push(fn_sig.skip_binder().output().into());
|
||||
ty::FnPtr(sig_tys, _hdr) => {
|
||||
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