Rollup merge of #33656 - GuillaumeGomez:lifetime_bound, r=steveklabnik

Add lifetime's bounds in doc generation

Fixes #33653

![screenshot from 2016-05-15 15 30 38](https://cloud.githubusercontent.com/assets/3050060/15274445/024dbd5c-1ab2-11e6-9387-274301a05627.png)

r? @steveklabnik
This commit is contained in:
Manish Goregaokar 2016-05-18 14:07:44 +05:30
commit 7a759d7ab6

View File

@ -795,7 +795,17 @@ impl Clean<Lifetime> for hir::Lifetime {
impl Clean<Lifetime> for hir::LifetimeDef {
fn clean(&self, _: &DocContext) -> Lifetime {
Lifetime(self.lifetime.name.to_string())
if self.bounds.len() > 0 {
let mut s = format!("{}: {}",
self.lifetime.name.to_string(),
self.bounds[0].name.to_string());
for bound in self.bounds.iter().skip(1) {
s.push_str(&format!(" + {}", bound.name.to_string()));
}
Lifetime(s)
} else {
Lifetime(self.lifetime.name.to_string())
}
}
}