1
Fork 0

Hide negative coherence checks under negative_impls feature flag

This commit is contained in:
Santiago Pastorino 2021-10-22 17:54:20 -03:00
parent 9e264137e9
commit 9534186857
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
5 changed files with 37 additions and 4 deletions

View file

@ -233,10 +233,11 @@ fn overlap_within_probe(
.unwrap_or(false)
} else {
!selcx.predicate_may_hold_fatal(o)
|| o.flip_polarity(tcx)
.as_ref()
.map(|o| selcx.infcx().predicate_must_hold_modulo_regions(o))
.unwrap_or(false)
|| tcx.features().negative_impls
&& o.flip_polarity(tcx)
.as_ref()
.map(|o| selcx.infcx().predicate_must_hold_modulo_regions(o))
.unwrap_or(false)
}
});
// FIXME: the call to `selcx.predicate_may_hold_fatal` above should be ported