Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 6a33de0

Browse files
committed
Name function correctly
1 parent 9a7e66a commit 6a33de0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
168168
}
169169
});
170170

171-
if !self.type_has_partial_eq_impl(cv.ty) {
171+
if !self.type_may_have_partial_eq_impl(cv.ty) {
172172
// span_fatal avoids ICE from resolution of non-existent method (rare case).
173173
self.tcx().sess.span_fatal(self.span, &msg);
174174
} else if mir_structural_match_violation && !self.saw_const_match_lint.get() {
@@ -190,7 +190,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
190190
inlined_const_as_pat
191191
}
192192

193-
fn type_has_partial_eq_impl(&self, ty: Ty<'tcx>) -> bool {
193+
fn type_may_have_partial_eq_impl(&self, ty: Ty<'tcx>) -> bool {
194194
// double-check there even *is* a semantic `PartialEq` to dispatch to.
195195
//
196196
// (If there isn't, then we can safely issue a hard
@@ -267,7 +267,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
267267
PatKind::Wild
268268
}
269269
ty::Adt(..)
270-
if !self.type_has_partial_eq_impl(cv.ty)
270+
if !self.type_may_have_partial_eq_impl(cv.ty)
271271
// FIXME(#73448): Find a way to bring const qualification into parity with
272272
// `search_for_structural_match_violation` and then remove this condition.
273273
&& self.search_for_structural_match_violation(cv.ty).is_some() =>

0 commit comments

Comments
 (0)