Skip to content

Commit 9fa6947

Browse files
committed
Inline and remove generic_args_may_unify.
It has a single callsite.
1 parent 47225e8 commit 9fa6947

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

compiler/rustc_middle/src/ty/fast_reject.rs

+12-19
Original file line numberDiff line numberDiff line change
@@ -193,26 +193,19 @@ impl DeepRejectCtxt {
193193
obligation_substs: SubstsRef<'tcx>,
194194
impl_substs: SubstsRef<'tcx>,
195195
) -> bool {
196-
iter::zip(obligation_substs, impl_substs)
197-
.all(|(obl, imp)| self.generic_args_may_unify(obl, imp))
198-
}
199-
200-
pub fn generic_args_may_unify<'tcx>(
201-
self,
202-
obligation_arg: ty::GenericArg<'tcx>,
203-
impl_arg: ty::GenericArg<'tcx>,
204-
) -> bool {
205-
match (obligation_arg.unpack(), impl_arg.unpack()) {
206-
// We don't fast reject based on regions for now.
207-
(GenericArgKind::Lifetime(_), GenericArgKind::Lifetime(_)) => true,
208-
(GenericArgKind::Type(obl), GenericArgKind::Type(imp)) => {
209-
self.types_may_unify(obl, imp)
210-
}
211-
(GenericArgKind::Const(obl), GenericArgKind::Const(imp)) => {
212-
self.consts_may_unify(obl, imp)
196+
iter::zip(obligation_substs, impl_substs).all(|(obl, imp)| {
197+
match (obl.unpack(), imp.unpack()) {
198+
// We don't fast reject based on regions for now.
199+
(GenericArgKind::Lifetime(_), GenericArgKind::Lifetime(_)) => true,
200+
(GenericArgKind::Type(obl), GenericArgKind::Type(imp)) => {
201+
self.types_may_unify(obl, imp)
202+
}
203+
(GenericArgKind::Const(obl), GenericArgKind::Const(imp)) => {
204+
self.consts_may_unify(obl, imp)
205+
}
206+
_ => bug!("kind mismatch: {obl} {imp}"),
213207
}
214-
_ => bug!("kind mismatch: {obligation_arg} {impl_arg}"),
215-
}
208+
})
216209
}
217210

218211
pub fn types_may_unify<'tcx>(self, obligation_ty: Ty<'tcx>, impl_ty: Ty<'tcx>) -> bool {

0 commit comments

Comments
 (0)