]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/_match.rs
Rollup merge of #105100 - jhpratt:fix-docs, r=JohnTitor
[rust.git] / compiler / rustc_hir_typeck / src / _match.rs
index 31432bb6e417005021ce63f5c558e4d29d6ea916..e25a9e9036a15607e6b2000aac8c03f8281eaa63 100644 (file)
@@ -539,17 +539,19 @@ pub(crate) fn opt_suggest_box_span(
                         .subst_iter_copied(self.tcx, substs)
                     {
                         let pred = pred.kind().rebind(match pred.kind().skip_binder() {
-                            ty::PredicateKind::Trait(trait_pred) => {
+                            ty::PredicateKind::Clause(ty::Clause::Trait(trait_pred)) => {
                                 assert_eq!(trait_pred.trait_ref.self_ty(), opaque_ty);
-                                ty::PredicateKind::Trait(trait_pred.with_self_type(self.tcx, ty))
+                                ty::PredicateKind::Clause(ty::Clause::Trait(
+                                    trait_pred.with_self_type(self.tcx, ty),
+                                ))
                             }
-                            ty::PredicateKind::Projection(mut proj_pred) => {
+                            ty::PredicateKind::Clause(ty::Clause::Projection(mut proj_pred)) => {
                                 assert_eq!(proj_pred.projection_ty.self_ty(), opaque_ty);
                                 proj_pred.projection_ty.substs = self.tcx.mk_substs_trait(
                                     ty,
                                     proj_pred.projection_ty.substs.iter().skip(1),
                                 );
-                                ty::PredicateKind::Projection(proj_pred)
+                                ty::PredicateKind::Clause(ty::Clause::Projection(proj_pred))
                             }
                             _ => continue,
                         });
@@ -572,8 +574,5 @@ pub(crate) fn opt_suggest_box_span(
 }
 
 fn arms_contain_ref_bindings<'tcx>(arms: &'tcx [hir::Arm<'tcx>]) -> Option<hir::Mutability> {
-    arms.iter().filter_map(|a| a.pat.contains_explicit_ref_binding()).max_by_key(|m| match *m {
-        hir::Mutability::Mut => 1,
-        hir::Mutability::Not => 0,
-    })
+    arms.iter().filter_map(|a| a.pat.contains_explicit_ref_binding()).max()
 }