From 6a33de017007233346c26a6f7b20c3e35e6b9e90 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Wed, 23 Sep 2020 17:55:14 +0200 Subject: [PATCH] Name function correctly --- compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index f80c60b181e..78b0a5a82eb 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -168,7 +168,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> { } }); - if !self.type_has_partial_eq_impl(cv.ty) { + if !self.type_may_have_partial_eq_impl(cv.ty) { // span_fatal avoids ICE from resolution of non-existent method (rare case). self.tcx().sess.span_fatal(self.span, &msg); } else if mir_structural_match_violation && !self.saw_const_match_lint.get() { @@ -190,7 +190,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> { inlined_const_as_pat } - fn type_has_partial_eq_impl(&self, ty: Ty<'tcx>) -> bool { + fn type_may_have_partial_eq_impl(&self, ty: Ty<'tcx>) -> bool { // double-check there even *is* a semantic `PartialEq` to dispatch to. // // (If there isn't, then we can safely issue a hard @@ -267,7 +267,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> { PatKind::Wild } ty::Adt(..) - if !self.type_has_partial_eq_impl(cv.ty) + if !self.type_may_have_partial_eq_impl(cv.ty) // FIXME(#73448): Find a way to bring const qualification into parity with // `search_for_structural_match_violation` and then remove this condition. && self.search_for_structural_match_violation(cv.ty).is_some() =>