Skip to content

Commit

Permalink
Remove a hack that has become obsolete after rust-lang#108080
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 30, 2023
1 parent e40b51d commit 7a2f47c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,7 @@ impl<'tcx> ConstToPat<'tcx> {
);

// FIXME: should this call a `predicate_must_hold` variant instead?
let has_impl = self.infcx.predicate_may_hold(&partial_eq_obligation);

// Note: To fix rust-lang/rust#65466, we could just remove this type
// walk hack for function pointers, and unconditionally error
// if `PartialEq` is not implemented. However, that breaks stable
// code at the moment, because types like `for <'a> fn(&'a ())` do
// not *yet* implement `PartialEq`. So for now we leave this here.
has_impl
|| ty.walk().any(|t| match t.unpack() {
ty::subst::GenericArgKind::Lifetime(_) => false,
ty::subst::GenericArgKind::Type(t) => t.is_fn_ptr(),
ty::subst::GenericArgKind::Const(_) => false,
})
self.infcx.predicate_may_hold(&partial_eq_obligation)
}

fn field_pats(
Expand Down

0 comments on commit 7a2f47c

Please sign in to comment.