Add GenericParam, refactor Generics in ast, hir, rustdoc

The Generics now contain one Vec of an enum for the generic parameters,
rather than two separate Vec's for lifetime and type parameters.

Additionally, places that previously used Vec<LifetimeDef> now use
Vec<GenericParam> instead.
This commit is contained in:
Jonas Platte
2017-10-16 21:07:26 +02:00
parent ab7abfcf34
commit 78493ed21a
51 changed files with 1020 additions and 832 deletions

View File

@@ -1424,8 +1424,10 @@ impl DocFolder for Cache {
impl<'a> Cache {
fn generics(&mut self, generics: &clean::Generics) {
for typ in &generics.type_params {
self.typarams.insert(typ.did, typ.name.clone());
for param in &generics.params {
if let clean::GenericParam::Type(ref typ) = *param {
self.typarams.insert(typ.did, typ.name.clone());
}
}
}
}