File tree 1 file changed +2
-8
lines changed
compiler/rustc_trait_selection/src/traits/error_reporting
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> {
3185
3185
&& let predicates = self . tcx . predicates_of ( def_id) . instantiate_identity ( self . tcx )
3186
3186
&& let Some ( pred) = predicates. predicates . get ( * idx)
3187
3187
{
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 ( )
3196
3190
{
3197
3191
let mut c = CollectAllMismatches {
3198
3192
infcx : self . infcx ,
You can’t perform that action at this time.
0 commit comments