Skip to content

Commit a4f1fcd

Browse files
committed
fix rustdoc
1 parent 4fe5ebb commit a4f1fcd

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

Diff for: src/librustdoc/clean/mod.rs

+20-12
Original file line numberDiff line numberDiff line change
@@ -1659,16 +1659,23 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
16591659
.predicates
16601660
.iter()
16611661
.filter_map(|predicate| {
1662-
let trait_ref = if let Some(tr) = predicate.to_opt_poly_trait_ref() {
1663-
tr
1664-
} else if let Some(pred) = predicate.to_opt_type_outlives() {
1665-
// these should turn up at the end
1666-
if let Some(r) = pred.skip_binder().1.clean(cx) {
1667-
regions.push(GenericBound::Outlives(r));
1662+
// Note: The substs of opaque types can contain unbound variables,
1663+
// meaning that we have to use `ignore_qualifiers_with_unbound_vars` here.
1664+
let trait_ref = match predicate
1665+
.ignore_qualifiers_with_unbound_vars(cx.tcx)
1666+
.skip_binder()
1667+
.kind()
1668+
{
1669+
ty::PredicateKind::Trait(tr, _constness) => {
1670+
ty::Binder::bind(tr.trait_ref)
1671+
}
1672+
ty::PredicateKind::TypeOutlives(pred) => {
1673+
if let Some(r) = pred.1.clean(cx) {
1674+
regions.push(GenericBound::Outlives(r));
1675+
}
1676+
return None;
16681677
}
1669-
return None;
1670-
} else {
1671-
return None;
1678+
_ => return None,
16721679
};
16731680

16741681
if let Some(sized) = cx.tcx.lang_items().sized_trait() {
@@ -1682,10 +1689,11 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
16821689
.predicates
16831690
.iter()
16841691
.filter_map(|pred| {
1685-
if let ty::PredicateKind::Projection(proj) =
1686-
pred.ignore_qualifiers().skip_binder().kind()
1692+
if let ty::PredicateKind::Projection(proj) = pred
1693+
.ignore_qualifiers_with_unbound_vars(cx.tcx)
1694+
.skip_binder()
1695+
.kind()
16871696
{
1688-
let proj = proj;
16891697
if proj.projection_ty.trait_ref(cx.tcx)
16901698
== *trait_ref.skip_binder()
16911699
{

0 commit comments

Comments
 (0)