From 66c179946be7711a82d1060de3bf2085e38c1432 Mon Sep 17 00:00:00 2001 From: Jack Huey Date: Wed, 6 Jan 2021 16:12:02 -0500 Subject: [PATCH] Use no_bound_vars --- compiler/rustc_traits/src/implied_outlives_bounds.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_traits/src/implied_outlives_bounds.rs b/compiler/rustc_traits/src/implied_outlives_bounds.rs index dc2eaf82d092..cf7101ff7127 100644 --- a/compiler/rustc_traits/src/implied_outlives_bounds.rs +++ b/compiler/rustc_traits/src/implied_outlives_bounds.rs @@ -94,11 +94,9 @@ fn compute_implied_outlives_bounds<'tcx>( // region relationships. implied_bounds.extend(obligations.into_iter().flat_map(|obligation| { assert!(!obligation.has_escaping_bound_vars()); - let binder = obligation.predicate.bound_atom(); - if binder.skip_binder().has_escaping_bound_vars() { - vec![] - } else { - match binder.skip_binder() { + match obligation.predicate.bound_atom().no_bound_vars() { + None => vec![], + Some(pred) => match pred { ty::PredicateAtom::Trait(..) | ty::PredicateAtom::Subtype(..) | ty::PredicateAtom::Projection(..) @@ -122,7 +120,7 @@ fn compute_implied_outlives_bounds<'tcx>( tcx.push_outlives_components(ty_a, &mut components); implied_bounds_from_components(r_b, components) } - } + }, } })); }