@@ -12,6 +12,7 @@ use std::hash::{Hash, Hasher};
1212
1313use hir:: def_id:: LocalDefId ;
1414use rustc_hir as hir;
15+ use rustc_macros:: { TypeFoldable , TypeVisitable } ;
1516use rustc_middle:: traits:: query:: NoSolution ;
1617use rustc_middle:: traits:: solve:: Certainty ;
1718pub use rustc_middle:: traits:: * ;
@@ -35,9 +36,11 @@ use crate::infer::InferCtxt;
3536/// either identifying an `impl` (e.g., `impl Eq for i32`) that
3637/// satisfies the obligation, or else finding a bound that is in
3738/// scope. The eventual result is usually a `Selection` (defined below).
38- #[ derive( Clone ) ]
39+ #[ derive( Clone , TypeFoldable , TypeVisitable ) ]
3940pub struct Obligation < ' tcx , T > {
4041 /// The reason we have to prove this thing.
42+ #[ type_foldable( identity) ]
43+ #[ type_visitable( ignore) ]
4144 pub cause : ObligationCause < ' tcx > ,
4245
4346 /// The environment in which we should prove this thing.
@@ -51,6 +54,8 @@ pub struct Obligation<'tcx, T> {
5154 /// If this goes over a certain threshold, we abort compilation --
5255 /// in such cases, we can not say whether or not the predicate
5356 /// holds for certain. Stupid halting problem; such a drag.
57+ #[ type_foldable( identity) ]
58+ #[ type_visitable( ignore) ]
5459 pub recursion_depth : usize ,
5560}
5661
0 commit comments