Skip to content

Commit e1f1a12

Browse files
committed
change ast::ty_param into a struct.
1 parent df7d376 commit e1f1a12

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

src/libsyntax/ast.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ enum ty_param_bound {
121121

122122
#[auto_encode]
123123
#[auto_decode]
124-
type ty_param = {ident: ident, id: node_id, bounds: @~[ty_param_bound]};
124+
struct ty_param {
125+
ident: ident,
126+
id: node_id,
127+
bounds: @~[ty_param_bound]
128+
}
125129

126130
#[auto_encode]
127131
#[auto_decode]

src/libsyntax/ext/auto_encode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ priv impl ext_ctxt {
251251
span: span,
252252
});
253253

254-
{
254+
ast::ty_param {
255255
ident: ident,
256256
id: self.next_id(),
257257
bounds: @vec::append(~[bound], *bounds)
@@ -425,7 +425,7 @@ fn mk_impl(
425425
span: span,
426426
});
427427

428-
{
428+
ast::ty_param {
429429
ident: tp.ident,
430430
id: cx.next_id(),
431431
bounds: @vec::append(~[t_bound], *tp.bounds)

src/libsyntax/ext/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,6 @@ fn mk_ty_param(cx: ext_ctxt,
313313
ident: ast::ident,
314314
bounds: @~[ast::ty_param_bound])
315315
-> ast::ty_param {
316-
{ ident: ident, id: cx.next_id(), bounds: bounds }
316+
ast::ty_param { ident: ident, id: cx.next_id(), bounds: bounds }
317317
}
318318

src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl ext_ctxt: ext_ctxt_ast_builder {
177177
fn ty_param(id: ast::ident, +bounds: ~[ast::ty_param_bound])
178178
-> ast::ty_param
179179
{
180-
{ident: id, id: self.next_id(), bounds: @bounds}
180+
ast::ty_param { ident: id, id: self.next_id(), bounds: @bounds }
181181
}
182182

183183
fn arg(name: ident, ty: @ast::Ty) -> ast::arg {

src/libsyntax/fold.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ fn fold_ty_param_bound(tpb: ty_param_bound, fld: ast_fold) -> ty_param_bound {
148148
}
149149

150150
fn fold_ty_param(tp: ty_param, fld: ast_fold) -> ty_param {
151-
{ident: /* FIXME (#2543) */ copy tp.ident,
152-
id: fld.new_id(tp.id),
153-
bounds: @vec::map(*tp.bounds, |x| fold_ty_param_bound(*x, fld) )}
151+
ast::ty_param { ident: /* FIXME (#2543) */ copy tp.ident,
152+
id: fld.new_id(tp.id),
153+
bounds: @tp.bounds.map(|x| fold_ty_param_bound(*x, fld) )}
154154
}
155155

156156
fn fold_ty_params(tps: ~[ty_param], fld: ast_fold) -> ~[ty_param] {
157-
vec::map(tps, |x| fold_ty_param(*x, fld) )
157+
tps.map(|x| fold_ty_param(*x, fld))
158158
}
159159

160160
fn noop_fold_crate(c: crate_, fld: ast_fold) -> crate_ {

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ impl Parser {
24582458
fn parse_ty_param() -> ty_param {
24592459
let ident = self.parse_ident();
24602460
let bounds = self.parse_optional_ty_param_bounds();
2461-
return {ident: ident, id: self.get_id(), bounds: bounds};
2461+
ast::ty_param { ident: ident, id: self.get_id(), bounds: bounds }
24622462
}
24632463
24642464
fn parse_ty_params() -> ~[ty_param] {

0 commit comments

Comments
 (0)