1
Fork 0

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); quantifier.hash_stable(hcx, hasher);
goal.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>), And(&'tcx Goal<'tcx>, &'tcx Goal<'tcx>),
Not(&'tcx Goal<'tcx>), Not(&'tcx Goal<'tcx>),
DomainGoal(DomainGoal<'tcx>), DomainGoal(DomainGoal<'tcx>),
Quantified(QuantifierKind, ty::Binder<&'tcx Goal<'tcx>>) Quantified(QuantifierKind, ty::Binder<&'tcx Goal<'tcx>>),
CannotProve,
} }
impl<'tcx> Goal<'tcx> { impl<'tcx> Goal<'tcx> {

View file

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