Skip to content

Commit

Permalink
fix rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Jun 23, 2020
1 parent 4fe5ebb commit a4f1fcd
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,16 +1659,23 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
.predicates
.iter()
.filter_map(|predicate| {
let trait_ref = if let Some(tr) = predicate.to_opt_poly_trait_ref() {
tr
} else if let Some(pred) = predicate.to_opt_type_outlives() {
// these should turn up at the end
if let Some(r) = pred.skip_binder().1.clean(cx) {
regions.push(GenericBound::Outlives(r));
// Note: The substs of opaque types can contain unbound variables,
// meaning that we have to use `ignore_qualifiers_with_unbound_vars` here.
let trait_ref = match predicate
.ignore_qualifiers_with_unbound_vars(cx.tcx)
.skip_binder()
.kind()
{
ty::PredicateKind::Trait(tr, _constness) => {
ty::Binder::bind(tr.trait_ref)
}
ty::PredicateKind::TypeOutlives(pred) => {
if let Some(r) = pred.1.clean(cx) {
regions.push(GenericBound::Outlives(r));
}
return None;
}
return None;
} else {
return None;
_ => return None,
};

if let Some(sized) = cx.tcx.lang_items().sized_trait() {
Expand All @@ -1682,10 +1689,11 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
.predicates
.iter()
.filter_map(|pred| {
if let ty::PredicateKind::Projection(proj) =
pred.ignore_qualifiers().skip_binder().kind()
if let ty::PredicateKind::Projection(proj) = pred
.ignore_qualifiers_with_unbound_vars(cx.tcx)
.skip_binder()
.kind()
{
let proj = proj;
if proj.projection_ty.trait_ref(cx.tcx)
== *trait_ref.skip_binder()
{
Expand Down

0 comments on commit a4f1fcd

Please sign in to comment.