]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs
Rollup merge of #104121 - Lokathor:mir-opt-when-instruction-set-missing-on-callee...
[rust.git] / compiler / rustc_lint / src / opaque_hidden_inferred_bound.rs
index 7e0a8a0df16c02228bc6d419c5c6b6098244190c..03d6f4fd92687f192ac40cbf540209b057bdfeae 100644 (file)
@@ -74,7 +74,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
             // Liberate bound regions in the predicate since we
             // don't actually care about lifetimes in this check.
             let predicate = cx.tcx.liberate_late_bound_regions(def_id, pred.kind());
-            let ty::PredicateKind::Projection(proj) = predicate else {
+            let ty::PredicateKind::Clause(ty::Clause::Projection(proj)) = predicate else {
                 continue;
             };
             // Only check types, since those are the only things that may
@@ -116,12 +116,13 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
                     // If it's a trait bound and an opaque that doesn't satisfy it,
                     // then we can emit a suggestion to add the bound.
                     let add_bound = match (proj_term.kind(), assoc_pred.kind().skip_binder()) {
-                        (ty::Opaque(def_id, _), ty::PredicateKind::Trait(trait_pred)) => {
-                            Some(AddBound {
-                                suggest_span: cx.tcx.def_span(*def_id).shrink_to_hi(),
-                                trait_ref: trait_pred.print_modifiers_and_trait_path(),
-                            })
-                        }
+                        (
+                            ty::Opaque(def_id, _),
+                            ty::PredicateKind::Clause(ty::Clause::Trait(trait_pred)),
+                        ) => Some(AddBound {
+                            suggest_span: cx.tcx.def_span(*def_id).shrink_to_hi(),
+                            trait_ref: trait_pred.print_modifiers_and_trait_path(),
+                        }),
                         _ => None,
                     };
                     cx.emit_spanned_lint(