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:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user