Support unsized types with the type keyword

This commit is contained in:
Nick Cameron
2014-04-03 13:38:45 +13:00
parent c3b2f2b0c6
commit f78add10cd
39 changed files with 484 additions and 73 deletions

View File

@@ -447,6 +447,7 @@ pub fn fold_ty_param<T: Folder>(tp: &TyParam, fld: &mut T) -> TyParam {
TyParam {
ident: tp.ident,
id: id,
sized: tp.sized,
bounds: tp.bounds.map(|x| fold_ty_param_bound(x, fld)),
default: tp.default.map(|x| fld.fold_ty(x)),
span: tp.span
@@ -620,7 +621,7 @@ pub fn noop_fold_item_underscore<T: Folder>(i: &Item_, folder: &mut T) -> Item_
methods.iter().map(|x| folder.fold_method(*x)).collect()
)
}
ItemTrait(ref generics, ref traits, ref methods) => {
ItemTrait(ref generics, ref sized, ref traits, ref methods) => {
let methods = methods.iter().map(|method| {
match *method {
Required(ref m) => Required(folder.fold_type_method(m)),
@@ -628,6 +629,7 @@ pub fn noop_fold_item_underscore<T: Folder>(i: &Item_, folder: &mut T) -> Item_
}
}).collect();
ItemTrait(fold_generics(generics, folder),
*sized,
traits.iter().map(|p| fold_trait_ref(p, folder)).collect(),
methods)
}