Name function correctly
This commit is contained in:
parent
9a7e66aeaf
commit
6a33de0170
1 changed files with 3 additions and 3 deletions
|
@ -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).
|
// span_fatal avoids ICE from resolution of non-existent method (rare case).
|
||||||
self.tcx().sess.span_fatal(self.span, &msg);
|
self.tcx().sess.span_fatal(self.span, &msg);
|
||||||
} else if mir_structural_match_violation && !self.saw_const_match_lint.get() {
|
} 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
|
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.
|
// double-check there even *is* a semantic `PartialEq` to dispatch to.
|
||||||
//
|
//
|
||||||
// (If there isn't, then we can safely issue a hard
|
// (If there isn't, then we can safely issue a hard
|
||||||
|
@ -267,7 +267,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
|
||||||
PatKind::Wild
|
PatKind::Wild
|
||||||
}
|
}
|
||||||
ty::Adt(..)
|
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
|
// FIXME(#73448): Find a way to bring const qualification into parity with
|
||||||
// `search_for_structural_match_violation` and then remove this condition.
|
// `search_for_structural_match_violation` and then remove this condition.
|
||||||
&& self.search_for_structural_match_violation(cv.ty).is_some() =>
|
&& self.search_for_structural_match_violation(cv.ty).is_some() =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue