File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
compiler/rustc_infer/src/traits Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,27 @@ pub trait TraitEngine<'tcx, E: 'tcx>: 'tcx {
72
72
self . register_predicate_obligation ( infcx, obligation) ;
73
73
}
74
74
}
75
-
75
+ /// Go over the list of pending obligations and try to evaluate them.
76
+ ///
77
+ /// For each result:
78
+ /// Ok: remove the obligation from the list
79
+ /// Ambiguous: leave the obligation in the list to be evaluated later
80
+ /// Err: remove the obligation from the list and return an error
81
+ ///
82
+ /// Returns a list of errors from obligations that evaluated to Err.
76
83
#[ must_use]
77
84
fn select_where_possible ( & mut self , infcx : & InferCtxt < ' tcx > ) -> Vec < E > ;
78
85
79
86
fn collect_remaining_errors ( & mut self , infcx : & InferCtxt < ' tcx > ) -> Vec < E > ;
80
87
88
+ /// Evaluate all pending obligations, return error if they can't be evaluated.
89
+ ///
90
+ /// For each result:
91
+ /// Ok: remove the obligation from the list
92
+ /// Ambiguous: remove the obligation from the list and return an error
93
+ /// Err: remove the obligation from the list and return an error
94
+ ///
95
+ /// Returns a list of errors from obligations that evaluated to Ambiguous or Err.
81
96
#[ must_use]
82
97
fn select_all_or_error ( & mut self , infcx : & InferCtxt < ' tcx > ) -> Vec < E > {
83
98
let errors = self . select_where_possible ( infcx) ;
You can’t perform that action at this time.
0 commit comments