Skip to content

Commit bbd1c3a

Browse files
committed
Streamline some inputs/output traversals.
1 parent b9f3db6 commit bbd1c3a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Diff for: compiler/rustc_middle/src/ty/flags.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ impl FlagComputation {
251251
}
252252

253253
&ty::FnPtr(sig_tys, _) => self.bound_computation(sig_tys, |computation, sig_tys| {
254-
computation.add_tys(sig_tys.inputs());
255-
computation.add_ty(sig_tys.output());
254+
computation.add_tys(sig_tys.inputs_and_output);
256255
}),
257256
}
258257
}

Diff for: compiler/rustc_middle/src/ty/walk.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,9 @@ fn push_inner<'tcx>(stack: &mut TypeWalkerStack<'tcx>, parent: GenericArg<'tcx>)
189189
stack.extend(args.iter().rev());
190190
}
191191
ty::Tuple(ts) => stack.extend(ts.iter().rev().map(GenericArg::from)),
192-
ty::FnPtr(sig_tys, hdr) => {
193-
let fn_sig = sig_tys.with(hdr);
194-
stack.push(fn_sig.skip_binder().output().into());
192+
ty::FnPtr(sig_tys, _hdr) => {
195193
stack.extend(
196-
fn_sig.skip_binder().inputs().iter().copied().rev().map(|ty| ty.into()),
194+
sig_tys.skip_binder().inputs_and_output.iter().rev().map(|ty| ty.into()),
197195
);
198196
}
199197
},

0 commit comments

Comments
 (0)