@@ -12,6 +12,7 @@ use std::hash::{Hash, Hasher};
12
12
13
13
use hir::def_id::LocalDefId;
14
14
use rustc_hir as hir;
15
+ use rustc_macros::{TypeFoldable, TypeVisitable};
15
16
use rustc_middle::traits::query::NoSolution;
16
17
use rustc_middle::traits::solve::Certainty;
17
18
pub use rustc_middle::traits::*;
@@ -35,9 +36,11 @@ use crate::infer::InferCtxt;
35
36
/// either identifying an `impl` (e.g., `impl Eq for i32`) that
36
37
/// satisfies the obligation, or else finding a bound that is in
37
38
/// scope. The eventual result is usually a `Selection` (defined below).
38
- #[derive(Clone)]
39
+ #[derive(Clone, TypeFoldable, TypeVisitable )]
39
40
pub struct Obligation<'tcx, T> {
40
41
/// The reason we have to prove this thing.
42
+ #[type_foldable(identity)]
43
+ #[type_visitable(ignore)]
41
44
pub cause: ObligationCause<'tcx>,
42
45
43
46
/// The environment in which we should prove this thing.
@@ -51,6 +54,8 @@ pub struct Obligation<'tcx, T> {
51
54
/// If this goes over a certain threshold, we abort compilation --
52
55
/// in such cases, we can not say whether or not the predicate
53
56
/// holds for certain. Stupid halting problem; such a drag.
57
+ #[type_foldable(identity)]
58
+ #[type_visitable(ignore)]
54
59
pub recursion_depth: usize,
55
60
}
56
61
0 commit comments