Skip to content

Commit bc23565

Browse files
committed
Fix rustdoc
1 parent c4a3be6 commit bc23565

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ impl Clean<Item> for doctree::Trait {
972972

973973
impl Clean<Type> for ast::TraitRef {
974974
fn clean(&self, cx: &DocContext) -> Type {
975-
resolve_type(cx, self.path.clean(cx), None, self.ref_id)
975+
resolve_type(cx, self.path.clean(cx), self.ref_id)
976976
}
977977
}
978978

@@ -1258,8 +1258,19 @@ impl Clean<Type> for ast::Ty {
12581258
TyFixedLengthVec(ref ty, ref e) => FixedVector(box ty.clean(cx),
12591259
e.span.to_src(cx)),
12601260
TyTup(ref tys) => Tuple(tys.clean(cx)),
1261-
TyPath(ref p, ref tpbs, id) => {
1262-
resolve_type(cx, p.clean(cx), tpbs.clean(cx), id)
1261+
TyPath(ref p, id) => {
1262+
resolve_type(cx, p.clean(cx), id)
1263+
}
1264+
TyObjectSum(ref lhs, ref bounds) => {
1265+
let lhs_ty = lhs.clean(cx);
1266+
match lhs_ty {
1267+
ResolvedPath { path, typarams: None, did } => {
1268+
ResolvedPath { path: path, typarams: Some(bounds.clean(cx)), did: did}
1269+
}
1270+
_ => {
1271+
lhs_ty // shouldn't happen
1272+
}
1273+
}
12631274
}
12641275
TyClosure(ref c) => Closure(box c.clean(cx)),
12651276
TyProc(ref c) => Proc(box c.clean(cx)),
@@ -2110,8 +2121,8 @@ fn name_from_pat(p: &ast::Pat) -> String {
21102121
}
21112122

21122123
/// Given a Type, resolve it using the def_map
2113-
fn resolve_type(cx: &DocContext, path: Path,
2114-
tpbs: Option<Vec<TyParamBound>>,
2124+
fn resolve_type(cx: &DocContext,
2125+
path: Path,
21152126
id: ast::NodeId) -> Type {
21162127
let tcx = match cx.tcx_opt() {
21172128
Some(tcx) => tcx,
@@ -2148,7 +2159,7 @@ fn resolve_type(cx: &DocContext, path: Path,
21482159
_ => {}
21492160
};
21502161
let did = register_def(&*cx, def);
2151-
ResolvedPath { path: path, typarams: tpbs, did: did }
2162+
ResolvedPath { path: path, typarams: None, did: did }
21522163
}
21532164

21542165
fn register_def(cx: &DocContext, def: def::Def) -> ast::DefId {

0 commit comments

Comments
 (0)