1
Fork 0

Properly check for builtin derives

This commit is contained in:
clubby789 2023-02-16 17:17:55 +00:00
parent 999ac5f777
commit 90f642bb3d
8 changed files with 60 additions and 34 deletions

View file

@ -2097,7 +2097,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
// Ignore automatically derived impls and `!Trait` impls.
.filter(|&def_id| {
self.tcx.impl_polarity(def_id) != ty::ImplPolarity::Negative
|| self.tcx.is_builtin_derive(def_id)
|| self.tcx.is_automatically_derived(def_id)
})
.filter_map(|def_id| self.tcx.impl_trait_ref(def_id))
.map(ty::EarlyBinder::subst_identity)