diff options
| author | James Miller <bladeon@gmail.com> | 2013-07-06 12:47:42 +1200 | 
|---|---|---|
| committer | James Miller <bladeon@gmail.com> | 2013-07-07 22:51:09 +1200 | 
| commit | 97c5a44d3e805652a54a5693bbf2ab6d44db993b (patch) | |
| tree | d80edf6d0f724bcb435200078501f2564bd9f5f9 /src/libsyntax/fold.rs | |
| parent | 62c83bb17be9a47799d702a9470aa7a84012c782 (diff) | |
| download | rust-97c5a44d3e805652a54a5693bbf2ab6d44db993b.tar.gz rust-97c5a44d3e805652a54a5693bbf2ab6d44db993b.zip | |
De-share trait_ref
Also, makes the pretty-printer use & instead of @ as much as possible, which will help with later changes, though in the interim has produced some... interesting constructs.
Diffstat (limited to 'src/libsyntax/fold.rs')
| -rw-r--r-- | src/libsyntax/fold.rs | 12 | 
1 files changed, 6 insertions, 6 deletions
| diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index e9710c9e114..85eb499069b 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -162,7 +162,7 @@ pub fn fold_fn_decl(decl: &ast::fn_decl, fld: @ast_fold) -> ast::fn_decl { fn fold_ty_param_bound(tpb: &TyParamBound, fld: @ast_fold) -> TyParamBound { match *tpb { - TraitTyParamBound(ty) => TraitTyParamBound(fold_trait_ref(ty, fld)), + TraitTyParamBound(ref ty) => TraitTyParamBound(fold_trait_ref(ty, fld)), RegionTyParamBound => RegionTyParamBound } } @@ -296,10 +296,10 @@ pub fn noop_fold_item_underscore(i: &item_, fld: @ast_fold) -> item_ { let struct_def = fold_struct_def(*struct_def, fld); item_struct(struct_def, /* FIXME (#2543) */ copy *generics) } - item_impl(ref generics, ifce, ty, ref methods) => { + item_impl(ref generics, ref ifce, ty, ref methods) => { item_impl( fold_generics(generics, fld), - ifce.map(|p| fold_trait_ref(*p, fld)), + ifce.map(|p| fold_trait_ref(p, fld)), fld.fold_ty(ty), methods.map(|x| fld.fold_method(*x)) ) @@ -313,7 +313,7 @@ pub fn noop_fold_item_underscore(i: &item_, fld: @ast_fold) -> item_ { }; item_trait( fold_generics(generics, fld), - traits.map(|p| fold_trait_ref(*p, fld)), + traits.map(|p| fold_trait_ref(p, fld)), methods ) } @@ -335,8 +335,8 @@ fn fold_struct_def(struct_def: @ast::struct_def, fld: @ast_fold) } } -fn fold_trait_ref(p: @trait_ref, fld: @ast_fold) -> @trait_ref { - @ast::trait_ref { +fn fold_trait_ref(p: &trait_ref, fld: @ast_fold) -> trait_ref { + ast::trait_ref { path: fld.fold_path(&p.path), ref_id: fld.new_id(p.ref_id), } | 
