1- use crate :: infer:: InferCtxt ;
1+ use crate :: infer:: { DefiningAnchor , InferCtxt } ;
22use crate :: traits:: Obligation ;
33use rustc_hir:: def_id:: DefId ;
44use rustc_middle:: ty:: { self , ToPredicate , Ty } ;
@@ -36,7 +36,11 @@ pub trait TraitEngine<'tcx>: 'tcx {
3636 obligation : PredicateObligation < ' tcx > ,
3737 ) ;
3838
39- fn select_where_possible ( & mut self , infcx : & InferCtxt < ' tcx > ) -> Vec < FulfillmentError < ' tcx > > ;
39+ fn select_where_possible (
40+ & mut self ,
41+ infcx : & InferCtxt < ' tcx > ,
42+ defining_use_anchor : DefiningAnchor ,
43+ ) -> Vec < FulfillmentError < ' tcx > > ;
4044
4145 fn collect_remaining_errors ( & mut self ) -> Vec < FulfillmentError < ' tcx > > ;
4246
@@ -58,7 +62,11 @@ pub trait TraitEngineExt<'tcx> {
5862 obligations : impl IntoIterator < Item = PredicateObligation < ' tcx > > ,
5963 ) ;
6064
61- fn select_all_or_error ( & mut self , infcx : & InferCtxt < ' tcx > ) -> Vec < FulfillmentError < ' tcx > > ;
65+ fn select_all_or_error (
66+ & mut self ,
67+ infcx : & InferCtxt < ' tcx > ,
68+ defining_use_anchor : DefiningAnchor ,
69+ ) -> Vec < FulfillmentError < ' tcx > > ;
6270}
6371
6472impl < ' tcx , T : ?Sized + TraitEngine < ' tcx > > TraitEngineExt < ' tcx > for T {
@@ -72,8 +80,12 @@ impl<'tcx, T: ?Sized + TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
7280 }
7381 }
7482
75- fn select_all_or_error ( & mut self , infcx : & InferCtxt < ' tcx > ) -> Vec < FulfillmentError < ' tcx > > {
76- let errors = self . select_where_possible ( infcx) ;
83+ fn select_all_or_error (
84+ & mut self ,
85+ infcx : & InferCtxt < ' tcx > ,
86+ defining_use_anchor : DefiningAnchor ,
87+ ) -> Vec < FulfillmentError < ' tcx > > {
88+ let errors = self . select_where_possible ( infcx, defining_use_anchor) ;
7789 if !errors. is_empty ( ) {
7890 return errors;
7991 }
0 commit comments