diff options
| -rw-r--r-- | src/libsyntax/ast.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 |
6 files changed, 14 insertions, 10 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 6c4e2b283a6..a6e66cbf46a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -121,7 +121,11 @@ enum ty_param_bound { #[auto_encode] #[auto_decode] -type ty_param = {ident: ident, id: node_id, bounds: @~[ty_param_bound]}; +struct ty_param { + ident: ident, + id: node_id, + bounds: @~[ty_param_bound] +} #[auto_encode] #[auto_decode] diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index bc28e836802..a80a56fe4f1 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -251,7 +251,7 @@ priv impl ext_ctxt { span: span, }); - { + ast::ty_param { ident: ident, id: self.next_id(), bounds: @vec::append(~[bound], *bounds) @@ -425,7 +425,7 @@ fn mk_impl( span: span, }); - { + ast::ty_param { ident: tp.ident, id: cx.next_id(), bounds: @vec::append(~[t_bound], *tp.bounds) diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index a50952f75e7..9160a8b0a33 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -313,6 +313,6 @@ fn mk_ty_param(cx: ext_ctxt, ident: ast::ident, bounds: @~[ast::ty_param_bound]) -> ast::ty_param { - { ident: ident, id: cx.next_id(), bounds: bounds } + ast::ty_param { ident: ident, id: cx.next_id(), bounds: bounds } } diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 1b32ccc43d8..a6063b033cb 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -177,7 +177,7 @@ impl ext_ctxt: ext_ctxt_ast_builder { fn ty_param(id: ast::ident, +bounds: ~[ast::ty_param_bound]) -> ast::ty_param { - {ident: id, id: self.next_id(), bounds: @bounds} + ast::ty_param { ident: id, id: self.next_id(), bounds: @bounds } } fn arg(name: ident, ty: @ast::Ty) -> ast::arg { diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 0cd4dc7d0ad..2a832fc5f12 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -148,13 +148,13 @@ fn fold_ty_param_bound(tpb: ty_param_bound, fld: ast_fold) -> ty_param_bound { } fn fold_ty_param(tp: ty_param, fld: ast_fold) -> ty_param { - {ident: /* FIXME (#2543) */ copy tp.ident, - id: fld.new_id(tp.id), - bounds: @vec::map(*tp.bounds, |x| fold_ty_param_bound(*x, fld) )} + ast::ty_param { ident: /* FIXME (#2543) */ copy tp.ident, + id: fld.new_id(tp.id), + bounds: @tp.bounds.map(|x| fold_ty_param_bound(*x, fld) )} } fn fold_ty_params(tps: ~[ty_param], fld: ast_fold) -> ~[ty_param] { - vec::map(tps, |x| fold_ty_param(*x, fld) ) + tps.map(|x| fold_ty_param(*x, fld)) } fn noop_fold_crate(c: crate_, fld: ast_fold) -> crate_ { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 3ab5e6c862e..2a8014a218c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2458,7 +2458,7 @@ impl Parser { fn parse_ty_param() -> ty_param { let ident = self.parse_ident(); let bounds = self.parse_optional_ty_param_bounds(); - return {ident: ident, id: self.get_id(), bounds: bounds}; + ast::ty_param { ident: ident, id: self.get_id(), bounds: bounds } } fn parse_ty_params() -> ~[ty_param] { |
