Bug 1643201 - Cherry-pick some servo changes to derive_common.

Depends on D78199

Differential Revision: https://phabricator.services.mozilla.com/D78200
This commit is contained in:
Emilio Cobos Álvarez 2020-06-04 00:35:11 +00:00
Родитель 31ea245f41
Коммит fa85c059f7
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -7,7 +7,7 @@ use proc_macro2::{Span, TokenStream};
use quote::TokenStreamExt;
use syn::{self, AngleBracketedGenericArguments, Binding, DeriveInput, Field};
use syn::{GenericArgument, GenericParam, Ident, Path};
use syn::{PathArguments, PathSegment, QSelf, Type, TypeArray};
use syn::{PathArguments, PathSegment, QSelf, Type, TypeArray, TypeGroup};
use syn::{TypeParam, TypeParen, TypePath, TypeSlice, TypeTuple};
use syn::{Variant, WherePredicate};
use synstructure::{self, BindStyle, BindingInfo, VariantAst, VariantInfo};
@ -208,6 +208,10 @@ where
elem: Box::new(map_type_params(&inner.elem, params, f)),
..inner.clone()
}),
Type::Group(ref inner) => Type::from(TypeGroup {
elem: Box::new(map_type_params(&inner.elem, params, f)),
..inner.clone()
}),
ref ty => panic!("type {:?} cannot be mapped yet", ty),
}
}