File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,17 @@ pub struct PathSeg(pub DefId, pub usize);
4242pub trait AstConv < ' tcx > {
4343 fn tcx < ' a > ( & ' a self ) -> TyCtxt < ' tcx > ;
4444
45- /// Returns the set of bounds in scope for the type parameter with
46- /// the given id.
45+ /// Returns predicates in scope of the form `X: Foo`, where `X` is
46+ /// a type parameter `X` with the given id `def_id`. This is a
47+ /// subset of the full set of predicates.
48+ ///
49+ /// This is used for one specific purpose: resolving "short-hand"
50+ /// associated type references like `T::Item`. In principle, we
51+ /// would do that by first getting the full set of predicates in
52+ /// scope and then filtering down to find those that apply to `T`,
53+ /// but this can lead to cycle errors. The problem is that we have
54+ /// to do this resolution *in order to create the predicates in
55+ /// the first place*. Hence, we have this "special pass".
4756 fn get_type_parameter_bounds ( & self , span : Span , def_id : DefId )
4857 -> & ' tcx ty:: GenericPredicates < ' tcx > ;
4958
Original file line number Diff line number Diff line change @@ -250,6 +250,8 @@ impl AstConv<'tcx> for ItemCtxt<'tcx> {
250250 }
251251}
252252
253+ /// Returns the predicates defined on `item_def_id` of the form
254+ /// `X: Foo` where `X` is the type parameter `def_id`.
253255fn type_param_predicates (
254256 tcx : TyCtxt < ' _ > ,
255257 ( item_def_id, def_id) : ( DefId , DefId ) ,
You can’t perform that action at this time.
0 commit comments