]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_trait_selection/traits/error_reporting/suggestions.rs
introduce PredicateAtom
[rust.git] / src / librustc_trait_selection / traits / error_reporting / suggestions.rs
index 0632ce2319aeef1d462898e2537243cbcd7f0d42..200de47244e4f8d4c367f1badf660d6c7b3d33b5 100644 (file)
@@ -1299,10 +1299,8 @@ fn maybe_note_obligation_cause_for_async_await(
         // the type. The last generator (`outer_generator` below) has information about where the
         // bound was introduced. At least one generator should be present for this diagnostic to be
         // modified.
-        let (mut trait_ref, mut target_ty) = match obligation.predicate.kind() {
-            ty::PredicateKind::Trait(p, _) => {
-                (Some(p.skip_binder().trait_ref), Some(p.skip_binder().self_ty()))
-            }
+        let (mut trait_ref, mut target_ty) = match obligation.predicate.skip_binders() {
+            ty::PredicateAtom::Trait(p, _) => (Some(p.trait_ref), Some(p.self_ty())),
             _ => (None, None),
         };
         let mut generator = None;