change ast::ty_param into a struct.
This commit is contained in:
parent
df7d376d25
commit
e1f1a1204a
6 changed files with 14 additions and 10 deletions
|
@ -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]
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
ast::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) )}
|
||||
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_ {
|
||||
|
|
|
@ -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] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue