add some comments to Obligation
This commit is contained in:
parent
803bd76127
commit
e7efce2361
1 changed files with 12 additions and 1 deletions
|
|
@ -77,10 +77,21 @@ pub enum IntercrateMode {
|
|||
/// scope. The eventual result is usually a `Selection` (defined below).
|
||||
#[derive(Clone, PartialEq, Eq, Hash)]
|
||||
pub struct Obligation<'tcx, T> {
|
||||
/// Why do we have to prove this thing?
|
||||
pub cause: ObligationCause<'tcx>,
|
||||
|
||||
/// In which environment should we prove this thing?
|
||||
pub param_env: ty::ParamEnv<'tcx>,
|
||||
pub recursion_depth: usize,
|
||||
|
||||
/// What are we trying to prove?
|
||||
pub predicate: T,
|
||||
|
||||
/// If we started proving this as a result of trying to prove
|
||||
/// something else, track the total depth to ensure termination.
|
||||
/// If this goes over a certain threshold, we abort compilation --
|
||||
/// in such cases, we can not say whether or not the predicate
|
||||
/// holds for certain. Stupid halting problem. Such a drag.
|
||||
pub recursion_depth: usize,
|
||||
}
|
||||
|
||||
pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue