Skip to content

Commit b9f3db6

Browse files
committed
Give the field in FnSigTys a name.
1 parent f4a3ed0 commit b9f3db6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Diff for: compiler/rustc_type_ir/src/fast_reject.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ impl<I: Interner> DeepRejectCtxt<I> {
311311
}
312312
ty::FnPtr(obl_sig_tys, obl_hdr) => match k {
313313
ty::FnPtr(impl_sig_tys, impl_hdr) => {
314-
let obl_sig_tys = obl_sig_tys.skip_binder().0;
315-
let impl_sig_tys = impl_sig_tys.skip_binder().0;
314+
let obl_sig_tys = obl_sig_tys.skip_binder().inputs_and_output;
315+
let impl_sig_tys = impl_sig_tys.skip_binder().inputs_and_output;
316316

317317
obl_hdr == impl_hdr
318318
&& obl_sig_tys.len() == impl_sig_tys.len()

Diff for: compiler/rustc_type_ir/src/ty_kind.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ impl<I: Interner> ty::Binder<I, FnSig<I>> {
928928
pub fn split(self) -> (ty::Binder<I, FnSigTys<I>>, FnHeader<I>) {
929929
let hdr =
930930
FnHeader { c_variadic: self.c_variadic(), safety: self.safety(), abi: self.abi() };
931-
(self.map_bound(|sig| FnSigTys(sig.inputs_and_output)), hdr)
931+
(self.map_bound(|sig| FnSigTys { inputs_and_output: sig.inputs_and_output }), hdr)
932932
}
933933
}
934934

@@ -971,23 +971,25 @@ impl<I: Interner> fmt::Debug for FnSig<I> {
971971
#[derive_where(Clone, Copy, Debug, PartialEq, Eq, Hash; I: Interner)]
972972
#[cfg_attr(feature = "nightly", derive(TyEncodable, TyDecodable, HashStable_NoContext))]
973973
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic)]
974-
pub struct FnSigTys<I: Interner>(pub I::Tys);
974+
pub struct FnSigTys<I: Interner> {
975+
pub inputs_and_output: I::Tys,
976+
}
975977

976978
impl<I: Interner> FnSigTys<I> {
977979
pub fn inputs(self) -> I::FnInputTys {
978-
self.0.inputs()
980+
self.inputs_and_output.inputs()
979981
}
980982

981983
pub fn output(self) -> I::Ty {
982-
self.0.output()
984+
self.inputs_and_output.output()
983985
}
984986
}
985987

986988
impl<I: Interner> ty::Binder<I, FnSigTys<I>> {
987989
// Used to combine the two fields in `TyKind::FnPtr` into a single value.
988990
pub fn with(self, hdr: FnHeader<I>) -> ty::Binder<I, FnSig<I>> {
989991
self.map_bound(|sig_tys| FnSig {
990-
inputs_and_output: sig_tys.0,
992+
inputs_and_output: sig_tys.inputs_and_output,
991993
c_variadic: hdr.c_variadic,
992994
safety: hdr.safety,
993995
abi: hdr.abi,
@@ -1006,7 +1008,7 @@ impl<I: Interner> ty::Binder<I, FnSigTys<I>> {
10061008
}
10071009

10081010
pub fn inputs_and_output(self) -> ty::Binder<I, I::Tys> {
1009-
self.map_bound(|sig_tys| sig_tys.0)
1011+
self.map_bound(|sig_tys| sig_tys.inputs_and_output)
10101012
}
10111013

10121014
#[inline]

0 commit comments

Comments
 (0)