]> git.lizzy.rs Git - rust.git/commitdiff
Name function correctly
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Wed, 23 Sep 2020 15:55:14 +0000 (17:55 +0200)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Wed, 23 Sep 2020 15:55:14 +0000 (17:55 +0200)
compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs

index f80c60b181ebc59332598d8aa3596c3cf50af81a..78b0a5a82eb55eec5e64387f16c92b4e0ff4e096 100644 (file)
@@ -168,7 +168,7 @@ fn to_pat(
                     }
                 });
 
-                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 @@ fn to_pat(
         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 @@ fn recur(
                 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() =>