diff options
| author | bors <bors@rust-lang.org> | 2020-10-17 10:28:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-17 10:28:52 +0000 |
| commit | 6f0ea299cfcb94aad6dc0a4fd06ae01153daf8fa (patch) | |
| tree | 352755212bf75978554c42881b56c37099120047 /src | |
| parent | 03687f8ffaf5ff03f6bedbe77752b9f930c7efeb (diff) | |
| parent | f6a53b4c691a5ba5ead6c0c0d072b301de1649f8 (diff) | |
| download | rust-6f0ea299cfcb94aad6dc0a4fd06ae01153daf8fa.tar.gz rust-6f0ea299cfcb94aad6dc0a4fd06ae01153daf8fa.zip | |
Auto merge of #77685 - jackh726:binder-map, r=lcnr
Use rebind instead of Binder::bind when possible These are really only the easy places. I just searched for `Binder::bind` and replaced where it straightforward. r? `@lcnr` cc. `@nikomatsakis`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/auto_trait.rs | 7 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 1ea1a091069..f39b53f3c82 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -315,12 +315,13 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { tcx: TyCtxt<'tcx>, pred: ty::Predicate<'tcx>, ) -> FxHashSet<GenericParamDef> { - let regions = match pred.skip_binders() { + let bound_predicate = pred.bound_atom(); + let regions = match bound_predicate.skip_binder() { ty::PredicateAtom::Trait(poly_trait_pred, _) => { - tcx.collect_referenced_late_bound_regions(&ty::Binder::bind(poly_trait_pred)) + tcx.collect_referenced_late_bound_regions(&bound_predicate.rebind(poly_trait_pred)) } ty::PredicateAtom::Projection(poly_proj_pred) => { - tcx.collect_referenced_late_bound_regions(&ty::Binder::bind(poly_proj_pred)) + tcx.collect_referenced_late_bound_regions(&bound_predicate.rebind(poly_proj_pred)) } _ => return FxHashSet::default(), }; diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 0365a8b48db..91941b00be2 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1689,7 +1689,10 @@ impl<'tcx> Clean<Type> for Ty<'tcx> { .filter_map(|bound| { // Note: The substs of opaque types can contain unbound variables, // meaning that we have to use `ignore_quantifiers_with_unbound_vars` here. - let trait_ref = match bound.bound_atom(cx.tcx).skip_binder() { + let trait_ref = match bound + .bound_atom_with_opt_escaping(cx.tcx) + .skip_binder() + { ty::PredicateAtom::Trait(tr, _constness) => { ty::Binder::bind(tr.trait_ref) } @@ -1713,7 +1716,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> { .iter() .filter_map(|bound| { if let ty::PredicateAtom::Projection(proj) = - bound.bound_atom(cx.tcx).skip_binder() + bound.bound_atom_with_opt_escaping(cx.tcx).skip_binder() { if proj.projection_ty.trait_ref(cx.tcx) == trait_ref.skip_binder() |
