@@ -81,6 +81,7 @@ pub(super) enum CandidateSource {
8181 AliasBound ,
8282}
8383
84+ /// Methods used to assemble candidates for either trait or projection goals.
8485pub ( super ) trait GoalKind < ' tcx > : TypeFoldable < ' tcx > + Copy + Eq {
8586 fn self_ty ( self ) -> Ty < ' tcx > ;
8687
@@ -188,6 +189,11 @@ pub(super) trait GoalKind<'tcx>: TypeFoldable<'tcx> + Copy + Eq {
188189 ecx : & mut EvalCtxt < ' _ , ' tcx > ,
189190 goal : Goal < ' tcx , Self > ,
190191 ) -> Vec < CanonicalResponse < ' tcx > > ;
192+
193+ fn consider_builtin_discriminant_kind_candidate (
194+ ecx : & mut EvalCtxt < ' _ , ' tcx > ,
195+ goal : Goal < ' tcx , Self > ,
196+ ) -> QueryResult < ' tcx > ;
191197}
192198
193199impl < ' tcx > EvalCtxt < ' _ , ' tcx > {
@@ -320,6 +326,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
320326 G :: consider_builtin_generator_candidate ( self , goal)
321327 } else if lang_items. unsize_trait ( ) == Some ( trait_def_id) {
322328 G :: consider_builtin_unsize_candidate ( self , goal)
329+ } else if lang_items. discriminant_kind_trait ( ) == Some ( trait_def_id) {
330+ G :: consider_builtin_discriminant_kind_candidate ( self , goal)
323331 } else {
324332 Err ( NoSolution )
325333 } ;
0 commit comments