add Goal::CannotProve and extract ProgramClause struct

This commit is contained in:
Niko Matsakis 2018-03-23 04:58:18 -04:00
parent c8a52850cf
commit cfbf62f7df
3 changed files with 5 additions and 1 deletions

View File

@ -1413,6 +1413,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for traits::Goal<'tcx> {
quantifier.hash_stable(hcx, hasher);
goal.hash_stable(hcx, hasher);
},
CannotProve => { },
}
}
}

View File

@ -286,7 +286,8 @@ pub enum Goal<'tcx> {
And(&'tcx Goal<'tcx>, &'tcx Goal<'tcx>),
Not(&'tcx Goal<'tcx>),
DomainGoal(DomainGoal<'tcx>),
Quantified(QuantifierKind, ty::Binder<&'tcx Goal<'tcx>>)
Quantified(QuantifierKind, ty::Binder<&'tcx Goal<'tcx>>),
CannotProve,
}
impl<'tcx> Goal<'tcx> {

View File

@ -491,6 +491,7 @@ impl<'tcx> fmt::Display for traits::Goal<'tcx> {
// FIXME: appropriate binder names
write!(fmt, "{}<> {{ {} }}", qkind, goal.skip_binder())
}
CannotProve => write!(fmt, "CannotProve"),
}
}
}
@ -557,6 +558,7 @@ EnumTypeFoldableImpl! {
(traits::Goal::Not)(goal),
(traits::Goal::DomainGoal)(domain_goal),
(traits::Goal::Quantified)(qkind, goal),
(traits::Goal::CannotProve),
}
}