Skip to content

Commit 7a2f47c

Browse files
committed
Remove a hack that has become obsolete after rust-lang#108080
1 parent e40b51d commit 7a2f47c

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,7 @@ impl<'tcx> ConstToPat<'tcx> {
187187
);
188188

189189
// FIXME: should this call a `predicate_must_hold` variant instead?
190-
let has_impl = self.infcx.predicate_may_hold(&partial_eq_obligation);
191-
192-
// Note: To fix rust-lang/rust#65466, we could just remove this type
193-
// walk hack for function pointers, and unconditionally error
194-
// if `PartialEq` is not implemented. However, that breaks stable
195-
// code at the moment, because types like `for <'a> fn(&'a ())` do
196-
// not *yet* implement `PartialEq`. So for now we leave this here.
197-
has_impl
198-
|| ty.walk().any(|t| match t.unpack() {
199-
ty::subst::GenericArgKind::Lifetime(_) => false,
200-
ty::subst::GenericArgKind::Type(t) => t.is_fn_ptr(),
201-
ty::subst::GenericArgKind::Const(_) => false,
202-
})
190+
self.infcx.predicate_may_hold(&partial_eq_obligation)
203191
}
204192

205193
fn field_pats(

0 commit comments

Comments
 (0)