about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/clean/auto_trait.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs
index 1ea1a091069..f6a4dfd85a5 100644
--- a/src/librustdoc/clean/auto_trait.rs
+++ b/src/librustdoc/clean/auto_trait.rs
@@ -315,13 +315,16 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
         tcx: TyCtxt<'tcx>,
         pred: ty::Predicate<'tcx>,
     ) -> FxHashSet<GenericParamDef> {
-        let regions = match pred.skip_binders() {
-            ty::PredicateAtom::Trait(poly_trait_pred, _) => {
-                tcx.collect_referenced_late_bound_regions(&ty::Binder::bind(poly_trait_pred))
-            }
-            ty::PredicateAtom::Projection(poly_proj_pred) => {
-                tcx.collect_referenced_late_bound_regions(&ty::Binder::bind(poly_proj_pred))
-            }
+        let bound_predicate = pred.bound_atom(tcx);
+        let regions = match bound_predicate.skip_binder() {
+            ty::PredicateAtom::Trait(poly_trait_pred, _) => tcx
+                .collect_referenced_late_bound_regions(
+                    &bound_predicate.map_bound_ref(|_| poly_trait_pred),
+                ),
+            ty::PredicateAtom::Projection(poly_proj_pred) => tcx
+                .collect_referenced_late_bound_regions(
+                    &bound_predicate.map_bound_ref(|_| poly_proj_pred),
+                ),
             _ => return FxHashSet::default(),
         };