Make negative trait bounds work with the old trait solver
This commit is contained in:
parent
40a63cb06f
commit
03469c3f2e
5 changed files with 36 additions and 14 deletions
|
@ -200,6 +200,10 @@ impl<'tcx, O: Elaboratable<'tcx>> Elaborator<'tcx, O> {
|
|||
let bound_predicate = elaboratable.predicate().kind();
|
||||
match bound_predicate.skip_binder() {
|
||||
ty::PredicateKind::Clause(ty::Clause::Trait(data)) => {
|
||||
// Negative trait bounds do not imply any supertrait bounds
|
||||
if data.polarity == ty::ImplPolarity::Negative {
|
||||
return;
|
||||
}
|
||||
// Get predicates implied by the trait, or only super predicates if we only care about self predicates.
|
||||
let predicates = if self.only_self {
|
||||
tcx.super_predicates_of(data.def_id())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue