1
Fork 0

Auto merge of #108128 - clubby789:builtin-derived-attr, r=jackh726

Properly check for builtin derived code

Fixes #108122
This commit is contained in:
bors 2023-02-19 21:18:07 +00:00
commit 21e5b941e0
8 changed files with 60 additions and 34 deletions

View file

@ -2104,7 +2104,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)