File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
compiler/rustc_trait_selection/src/traits/error_reporting Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -3185,14 +3185,8 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
31853185 && let predicates = self . tcx . predicates_of ( def_id) . instantiate_identity ( self . tcx )
31863186 && let Some ( pred) = predicates. predicates . get ( * idx)
31873187 {
3188- if let Ok ( trait_pred) = pred. kind ( ) . try_map_bound ( |pred| match pred {
3189- ty:: PredicateKind :: Clause ( ty:: Clause :: Trait ( trait_pred) ) => Ok ( trait_pred) ,
3190- _ => Err ( ( ) ) ,
3191- } )
3192- && let Ok ( trait_predicate) = predicate. kind ( ) . try_map_bound ( |pred| match pred {
3193- ty:: PredicateKind :: Clause ( ty:: Clause :: Trait ( trait_pred) ) => Ok ( trait_pred) ,
3194- _ => Err ( ( ) ) ,
3195- } )
3188+ if let Some ( trait_pred) = pred. to_opt_poly_trait_pred ( )
3189+ && let Some ( trait_predicate) = predicate. to_opt_poly_trait_pred ( )
31963190 {
31973191 let mut c = CollectAllMismatches {
31983192 infcx : self . infcx ,
You can’t perform that action at this time.
0 commit comments