Remove ast::{Impl,Trait}{Item,ItemKind}.
This commit is contained in:
@@ -504,13 +504,13 @@ impl<'a> TraitDef<'a> {
|
||||
type_ident: Ident,
|
||||
generics: &Generics,
|
||||
field_tys: Vec<P<ast::Ty>>,
|
||||
methods: Vec<ast::ImplItem>)
|
||||
methods: Vec<ast::AssocItem>)
|
||||
-> P<ast::Item> {
|
||||
let trait_path = self.path.to_path(cx, self.span, type_ident, generics);
|
||||
|
||||
// Transform associated types from `deriving::ty::Ty` into `ast::ImplItem`
|
||||
// Transform associated types from `deriving::ty::Ty` into `ast::AssocItem`
|
||||
let associated_types = self.associated_types.iter().map(|&(ident, ref type_def)| {
|
||||
ast::ImplItem {
|
||||
ast::AssocItem {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
span: self.span,
|
||||
ident,
|
||||
@@ -518,7 +518,7 @@ impl<'a> TraitDef<'a> {
|
||||
defaultness: ast::Defaultness::Final,
|
||||
attrs: Vec::new(),
|
||||
generics: Generics::default(),
|
||||
kind: ast::ImplItemKind::TyAlias(
|
||||
kind: ast::AssocItemKind::TyAlias(
|
||||
Vec::new(),
|
||||
Some(type_def.to_ty(cx, self.span, type_ident, generics)),
|
||||
),
|
||||
@@ -912,7 +912,7 @@ impl<'a> MethodDef<'a> {
|
||||
explicit_self: Option<ast::ExplicitSelf>,
|
||||
arg_types: Vec<(Ident, P<ast::Ty>)>,
|
||||
body: P<Expr>)
|
||||
-> ast::ImplItem {
|
||||
-> ast::AssocItem {
|
||||
// Create the generics that aren't for `Self`.
|
||||
let fn_generics = self.generics.to_generics(cx, trait_.span, type_ident, generics);
|
||||
|
||||
@@ -950,7 +950,7 @@ impl<'a> MethodDef<'a> {
|
||||
};
|
||||
|
||||
// Create the method.
|
||||
ast::ImplItem {
|
||||
ast::AssocItem {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
attrs: self.attributes.clone(),
|
||||
generics: fn_generics,
|
||||
@@ -958,7 +958,7 @@ impl<'a> MethodDef<'a> {
|
||||
vis: respan(trait_lo_sp, ast::VisibilityKind::Inherited),
|
||||
defaultness: ast::Defaultness::Final,
|
||||
ident: method_ident,
|
||||
kind: ast::ImplItemKind::Method(sig, Some(body_block)),
|
||||
kind: ast::AssocItemKind::Method(sig, Some(body_block)),
|
||||
tokens: None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user