Skip to content

Commit 4362db0

Browse files
committed
auto merge of rust-lang#15089 : tomjakubowski/rust/rustdoc-default-typarams-12291, r=alexcrichton
fix rust-lang#12291
2 parents 9a583bb + 94bace7 commit 4362db0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/librustdoc/clean/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use visit_ast;
4040

4141
/// A stable identifier to the particular version of JSON output.
4242
/// Increment this when the `Crate` and related structures change.
43-
pub static SCHEMA_VERSION: &'static str = "0.8.2";
43+
pub static SCHEMA_VERSION: &'static str = "0.8.3";
4444

4545
mod inline;
4646

@@ -449,6 +449,7 @@ pub struct TyParam {
449449
pub name: String,
450450
pub did: ast::DefId,
451451
pub bounds: Vec<TyParamBound>,
452+
pub default: Option<Type>
452453
}
453454

454455
impl Clean<TyParam> for ast::TyParam {
@@ -457,6 +458,7 @@ impl Clean<TyParam> for ast::TyParam {
457458
name: self.ident.clean(),
458459
did: ast::DefId { krate: ast::LOCAL_CRATE, node: self.id },
459460
bounds: self.bounds.clean().move_iter().collect(),
461+
default: self.default.clean()
460462
}
461463
}
462464
}
@@ -470,6 +472,7 @@ impl Clean<TyParam> for ty::TypeParameterDef {
470472
name: self.ident.clean(),
471473
did: self.def_id,
472474
bounds: self.bounds.clean(),
475+
default: self.default.clean()
473476
}
474477
}
475478
}

src/librustdoc/html/format.rs

+5
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ impl fmt::Show for clean::Generics {
8282
try!(write!(f, "{}", *bound));
8383
}
8484
}
85+
86+
match tp.default {
87+
Some(ref ty) => { try!(write!(f, " = {}", ty)); },
88+
None => {}
89+
};
8590
}
8691
}
8792
try!(f.write("&gt;".as_bytes()));

0 commit comments

Comments
 (0)